@@ -166,6 +166,17 @@ class UrlMappingsTestMixinTests {
166166 assertUrlMapping(' /users/timmy' , controller : ' user' , action : ' update' , method : ' put' ) { name = ' timmy' }
167167 }
168168
169+ @Test
170+ @Issue (' https://github.com/grails/grails-core/issues/10226' )
171+ void testExceptionUrlMapping () {
172+ mockController(ExceptionTestErrorsController )
173+ mockUrlMappings(ExceptionTestUrlMappings )
174+
175+ assertForwardUrlMapping(500 , controller : ' exceptionTestErrors' , action : ' handleNullPointer' , exception : new NullPointerException ())
176+ assertForwardUrlMapping(500 , controller : ' exceptionTestErrors' , action : ' handleIllegalArgument' , exception : new IllegalArgumentException ())
177+ assertForwardUrlMapping(500 , controller : ' exceptionTestErrors' , action : ' handleDefault' )
178+ }
179+
169180 @Test
170181 @Issue (' https://github.com/grails/grails-core/issues/9065' )
171182 void testResourcesUrlMapping () {
@@ -282,3 +293,18 @@ class ResourceTestUrlMappings {
282293 ' /person' (resources : ' person' )
283294 }
284295}
296+
297+ @Artefact (" Controller" )
298+ class ExceptionTestErrorsController {
299+ def handleNullPointer () {}
300+ def handleIllegalArgument () {}
301+ def handleDefault () {}
302+ }
303+
304+ class ExceptionTestUrlMappings {
305+ static mappings = {
306+ ' 500' (controller : ' exceptionTestErrors' , action : ' handleNullPointer' , exception : NullPointerException )
307+ ' 500' (controller : ' exceptionTestErrors' , action : ' handleIllegalArgument' , exception : IllegalArgumentException )
308+ ' 500' (controller : ' exceptionTestErrors' , action : ' handleDefault' )
309+ }
310+ }
0 commit comments