How can I install an exception handler in Grails which catches all exceptions which propagate to the user?
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']
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With