I have a custom URLMapping that catch error codes and calls some code (used for monitoring of 5xx/4xx responses):
// Explicit error-handling for monitoring
"401"(controller:"error", action:"fail4x")
..
"501"(controller:"error", action:"fail5x")
...
I also have a filter that does some authentication stuff in the before closure, sets response status to 401 if it fails, and also returns false from the filter.
The problem is that the 401 isn't caught by URLMappings. According to the docs, returning false from a filter "[indicates] that the response has been handled that that all future filters and the action should not execute" - so I'm guessing that Grails just pretty much drops everything, including processing of the URLMapping that would normally catch other 4xx errors?
Is there a way around this so that my 401 from a failed filter is caught by URLMappings (assuming I've interpreted what is happening correctly, and explained it clearly!)
[Using Grails 2.1.1]
Cheers.