Open a-alhusaini opened 1 year ago
If you implement your own Error pipe and use it instead of Amber::Pipe::Error
you can have what you want. Not ideal since you end up needing to copy some code from Amber::Pipe::Error
but at least it's possible to do what you want.
Right now, if a validation fails the developer needs to write a block similar to this one in order to return a response:
A 400 response with the appropriate body should be the default procedure should a call to
validate!
fail. This simplifies error handling especially in situations where the response is json because in that scenario, you rarely want to return custom output in situations where the client created an invalid request.In situations where the user has a page then we can easily return a default error page. We should have default error pages anyway so we may as well add them while we add this enhancement to controller error handling.