You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2022/02/07 10:07:51 UTC

[sling-org-apache-sling-scripting-jsp] branch master updated: SLING-11027 preserve exception message (#7)

This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-jsp.git


The following commit(s) were added to refs/heads/master by this push:
     new a06ca5b  SLING-11027 preserve exception message (#7)
a06ca5b is described below

commit a06ca5b7144a62746030d98f9e20fa8f0cfb1e30
Author: Jörg Hoh <jo...@users.noreply.github.com>
AuthorDate: Mon Feb 7 11:07:44 2022 +0100

    SLING-11027 preserve exception message (#7)
---
 .../apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java b/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java
index 6845d8b..67f2268 100644
--- a/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java
+++ b/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java
@@ -612,7 +612,7 @@ public class JspServletWrapper {
     private Exception handleJspExceptionInternal(final Exception ex)
     throws ServletException {
     	Throwable realException = ex;
-        String exMessage = "";
+        String exMessage = realException.getMessage();
         if (ex instanceof ServletException) {
             realException = ((ServletException) ex).getRootCause();
             // root cause might be null (eg. for a JasperException ex)
@@ -626,6 +626,7 @@ public class JspServletWrapper {
         // avoid nested ScriptEvaluationExceptions (eg. in nested jsp includes)
         while (realException instanceof ScriptEvaluationException) {
             realException = realException.getCause();
+            exMessage = realException.getMessage();
         }
 
         try {