Reputation: 10429
I see the Grails pattern, where you can configure your UrlMappings so that certain types of exceptions are handling in a specific Controller which returns specific responses to your client.
Very good.
However, is there anyway to invoke the functionality of your ErrorController without raising an exception?
For example, a user enters the wrong password - you don't want to throw an exception because it is not really an exception. Instead, you want a service to return an InvalidResponse to a Controller and you would love then for the Controller to delegate out to your ErrorController where you have your generic, error handling.
Can this be done?
Thanks
Upvotes: 0
Views: 81