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

radu 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 6f14664  SLING-11724 - Improve exception handling in generated JSPs
6f14664 is described below

commit 6f14664b14d23944b233f8d21f8d3e955311e11a
Author: Radu Cotescu <[email protected]>
AuthorDate: Fri Dec 9 09:10:20 2022 +0100

    SLING-11724 - Improve exception handling in generated JSPs
    
    * allow treating exceptions even if the pageContext is null
---
 .../org/apache/sling/scripting/jsp/jasper/compiler/Generator.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/Generator.java 
b/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/Generator.java
index 4ee1baf..08ddf32 100644
--- 
a/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/Generator.java
+++ 
b/src/main/java/org/apache/sling/scripting/jsp/jasper/compiler/Generator.java
@@ -3330,8 +3330,8 @@ class Generator {
         out.printil("try { out.clearBuffer(); } catch (java.io.IOException e) 
{}");
         out.popIndent();
 
-        out
-                .printil("if (_jspx_page_context != null) 
_jspx_page_context.handlePageException(t);");
+        out.printil("if (_jspx_page_context != null) 
_jspx_page_context.handlePageException(t);");
+        out.printil("else throw new ServletException(t);");
         out.popIndent();
         out.printil("}");
         out.popIndent();

Reply via email to