How can I install an exception handler in Grails which catches all exceptions which propagate to the user?
+6
A:
You can override the exceptionHandler bean using resources.groovy with your own class that extends GrailsExceptionResolver
e.g.
beans = {
exceptionHandler(com.yourapp.YourExceptionHandler){
// this is required so that calls to super work
exceptionMappings = ['java.lang.Exception': '/error']
}
}
leebutts
2009-09-18 00:31:44