-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
We already have interface ErrorResponseProvider
. So it will be cool to allow use of service for this.
In case of validation errors responsibility of generating response should be:
- Target action if `` is required as one of arguments. In that case action responsible for handling errors.
public function someAction(SomeRequest $request, ConstraintViolationList $errors)
{
// handle manually
}
- Request object implements
ErrorResponseProvider
interface. In that case request object is responsible to provide error response. - Implementation of
ErrorResponseProvider
as a service.