tags:

views:

167

answers:

1

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