Skip to content

Commit 5068b58

Browse files
candrewslhotari
authored andcommitted
Exceptions inside includes should propogate up
See GRAILS-10992
1 parent b21a59f commit 5068b58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,17 @@ public Locale getLocale() {
373373
}
374374
}
375375
catch (ModelAndViewDefiningException ex) {
376+
// Exceptions inside includes should propogate up so the original dispatcher handles the exception
377+
if(WebUtils.isIncludeRequest(request)) throw ex;
376378
handlerException = ex;
377379
if (logger.isDebugEnabled()) {
378380
logger.debug("ModelAndViewDefiningException encountered", ex);
379381
}
380382
mv = ex.getModelAndView();
381383
}
382384
catch (Exception ex) {
385+
// Exceptions inside includes should propogate up so the original dispatcher handles the exception
386+
if(WebUtils.isIncludeRequest(request)) throw ex;
383387
handlerException = ex;
384388
Object handler = mappedHandler == null ? null : mappedHandler.getHandler();
385389
mv = processHandlerException(request, response, handler, ex);

0 commit comments

Comments
 (0)