This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-core.git
The following commit(s) were added to refs/heads/master by this push:
new c9f444f SLING-11307 : Different exception passed to error handler
with bundled scripts
c9f444f is described below
commit c9f444f6a621c4b63c978f3189aee55dbcbb9e4b
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Mon May 9 15:13:38 2022 +0200
SLING-11307 : Different exception passed to error handler with bundled
scripts
---
.../org/apache/sling/scripting/core/impl/DefaultSlingScript.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git
a/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
b/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
index fa7df41..1d6b25c 100644
--- a/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
+++ b/src/main/java/org/apache/sling/scripting/core/impl/DefaultSlingScript.java
@@ -418,6 +418,8 @@ class DefaultSlingScript implements SlingScript, Servlet,
ServletConfig {
throw new ScriptEvaluationException(this.scriptName,
ioe.getMessage(),
ioe);
+ } catch (ScriptEvaluationException see) {
+ throw see;
} catch (ScriptException se) {
Throwable cause = (se.getCause() == null) ? se : se.getCause();
throw new ScriptEvaluationException(this.scriptName,
se.getMessage(),
@@ -497,17 +499,12 @@ class DefaultSlingScript implements SlingScript, Servlet,
ServletConfig {
// evaluate the script now using the ScriptEngine
eval(props);
- } catch (ScriptEvaluationException see) {
+ } catch (RuntimeException see) {
// log in the request progress tracker
logScriptError(request, see);
throw see;
- } catch (SlingException e) {
- // log in the request progress tracker
- logScriptError(request, e);
-
- throw e;
} catch (Exception e) {
// log in the request progress tracker