From d8427cfc89536f6f5c4372b3924933bcf7726220 Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg <scott@alwaysvip.com> Date: Tue, 1 Oct 2024 23:33:58 -0700 Subject: [PATCH] Pass tag attributes to stackTracePrinter --- .../org/grails/plugins/web/taglib/RenderTagLib.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grails-web-gsp-taglib/src/main/groovy/org/grails/plugins/web/taglib/RenderTagLib.groovy b/grails-web-gsp-taglib/src/main/groovy/org/grails/plugins/web/taglib/RenderTagLib.groovy index f7cc0613c3..83b0b193be 100644 --- a/grails-web-gsp-taglib/src/main/groovy/org/grails/plugins/web/taglib/RenderTagLib.groovy +++ b/grails-web-gsp-taglib/src/main/groovy/org/grails/plugins/web/taglib/RenderTagLib.groovy @@ -76,7 +76,7 @@ class RenderTagLib implements TagLibrary { def currentOut = out int statusCode = request.getAttribute('jakarta.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('jakarta.servlet.error.request_uri'))}</dd> """ @@ -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>' }