diff --git a/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java b/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java index 90201d0cda7..30807c97cc7 100644 --- a/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java +++ b/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java @@ -347,6 +347,8 @@ public Locale getLocale() { } } catch (ModelAndViewDefiningException ex) { + // Exceptions inside includes should propogate up so the original dispatcher handles the exception + if(WebUtils.isIncludeRequest(request)) throw ex; handlerException = ex; if (logger.isDebugEnabled()) { logger.debug("ModelAndViewDefiningException encountered", ex); @@ -354,6 +356,8 @@ public Locale getLocale() { mv = ex.getModelAndView(); } catch (Exception ex) { + // Exceptions inside includes should propogate up so the original dispatcher handles the exception + if(WebUtils.isIncludeRequest(request)) throw ex; handlerException = ex; Object handler = (mappedHandler != null ? mappedHandler.getHandler() : null); mv = processHandlerException(request, response, handler, ex);