Skip to content

Commit

Permalink
Pass tag attributes to stackTracePrinter
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Oct 3, 2024
1 parent 96c2733 commit 46005c3
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RenderTagLib implements TagLibrary {
def currentOut = out
int statusCode = request.getAttribute('javax.servlet.error.status_code') as int
currentOut << """<h1>Error ${prettyPrintStatus(statusCode)}</h1>
<dl class="error-details">
<dl class="${attrs['detailsClass'] ?: 'error-details'}">
<dt>URI</dt><dd>${htmlEncoder.encode(WebUtils.getForwardURI(request) ?: request.getAttribute('javax.servlet.error.request_uri'))}</dd>
"""

Expand All @@ -88,12 +88,12 @@ class RenderTagLib implements TagLibrary {
}
currentOut << "</dl>"

currentOut << errorsViewStackTracePrinter.prettyPrintCodeSnippet(exception)
currentOut << errorsViewStackTracePrinter.prettyPrintCodeSnippet(exception, attrs)

def trace = errorsViewStackTracePrinter.prettyPrint(exception.cause ?: exception)
def trace = errorsViewStackTracePrinter.prettyPrint(exception.cause ?: exception, attrs)
if (StringUtils.hasText(trace.trim())) {
currentOut << "<h2>Trace</h2>"
currentOut << '<pre class="stack">'
currentOut << """<pre class="${attrs['stackClass'] ?: 'stack'}">"""
currentOut << htmlEncoder.encode(trace)
currentOut << '</pre>'
}
Expand Down

0 comments on commit 46005c3

Please sign in to comment.