Following an example with custom exception handling in Grails, I came to the following code:
exceptionHandler.exceptionMappings = [
'my.project.AccessDeniedException': '/accessDenied',
'my.project.NoSessionException' : '/accessDenied',
'java.lang.Exception': '/errorProduction'
]
This works fine for the first two types of exceptions, but all other exceptions, like GroovyPagesException, are not handled by Grails anymore, they are handled by the servlet container.
How can I handle all exceptions with Grails (1.3)?
This works:
UrlMappings.groovy:
And the controller: