Created
April 21, 2015 09:33
-
-
Save aadrian/9ebb145c8df7b4ecf1b3 to your computer and use it in GitHub Desktop.
Grails Improved error messages in production mode.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page import="org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver" %> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title><g:if env="development">Grails Runtime Exception</g:if><g:else>Error</g:else></title> | |
<meta name="layout" content="main"> | |
<g:if env="development"><link rel="stylesheet" href="${resource(dir: 'css', file: 'errors.css')}" type="text/css"></g:if> | |
</head> | |
<body> | |
<g:if env="development"> | |
<g:renderException exception="${exception}" /> | |
</g:if> | |
<g:else> | |
<div class="alert alert-danger alert-dismissible" role="status" role="alert"> | |
<strong>Error:</strong> | |
<hr/> | |
${exception.message?.encodeAsHTML()} | |
<% | |
def root = GrailsExceptionResolver.getRootCause(exception) | |
if (root != null && root != exception && root.message != exception.message) { | |
%> | |
<hr/> | |
${root.message?.encodeAsHTML()} | |
<% | |
} | |
%> | |
</div> | |
</g:else> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment