Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Commit 46005c3

Browse files
committed
Pass tag attributes to stackTracePrinter
1 parent 96c2733 commit 46005c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

grails-web-gsp-taglib/src/main/groovy/org/grails/plugins/web/taglib/RenderTagLib.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class RenderTagLib implements TagLibrary {
7676
def currentOut = out
7777
int statusCode = request.getAttribute('javax.servlet.error.status_code') as int
7878
currentOut << """<h1>Error ${prettyPrintStatus(statusCode)}</h1>
79-
<dl class="error-details">
79+
<dl class="${attrs['detailsClass'] ?: 'error-details'}">
8080
<dt>URI</dt><dd>${htmlEncoder.encode(WebUtils.getForwardURI(request) ?: request.getAttribute('javax.servlet.error.request_uri'))}</dd>
8181
"""
8282

@@ -88,12 +88,12 @@ class RenderTagLib implements TagLibrary {
8888
}
8989
currentOut << "</dl>"
9090

91-
currentOut << errorsViewStackTracePrinter.prettyPrintCodeSnippet(exception)
91+
currentOut << errorsViewStackTracePrinter.prettyPrintCodeSnippet(exception, attrs)
9292

93-
def trace = errorsViewStackTracePrinter.prettyPrint(exception.cause ?: exception)
93+
def trace = errorsViewStackTracePrinter.prettyPrint(exception.cause ?: exception, attrs)
9494
if (StringUtils.hasText(trace.trim())) {
9595
currentOut << "<h2>Trace</h2>"
96-
currentOut << '<pre class="stack">'
96+
currentOut << """<pre class="${attrs['stackClass'] ?: 'stack'}">"""
9797
currentOut << htmlEncoder.encode(trace)
9898
currentOut << '</pre>'
9999
}

0 commit comments

Comments
 (0)