You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2022/12/07 23:58:42 UTC

[maven-script-interpreter] branch master updated: catch this error to give more groovy error details (#87)

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

olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-script-interpreter.git


The following commit(s) were added to refs/heads/master by this push:
     new fa257aa  catch this error to give more groovy error details (#87)
fa257aa is described below

commit fa257aa10e555394d816d1e55cd9a3640901efa6
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Thu Dec 8 09:58:38 2022 +1000

    catch this error to give more groovy error details (#87)
    
    * simplify exception management
    Signed-off-by: Olivier Lamy <ol...@apache.org>
---
 .../shared/scriptinterpreter/GroovyScriptInterpreter.java  | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreter.java b/src/main/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreter.java
index ff5a7c2..7094b24 100644
--- a/src/main/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreter.java
+++ b/src/main/java/org/apache/maven/shared/scriptinterpreter/GroovyScriptInterpreter.java
@@ -21,13 +21,11 @@ package org.apache.maven.shared.scriptinterpreter;
 import groovy.lang.Binding;
 import groovy.lang.GroovyShell;
 import java.io.File;
-import java.io.IOException;
 import java.io.PrintStream;
 import java.net.URL;
 import java.util.List;
 import java.util.Map;
 import org.codehaus.groovy.control.CompilerConfiguration;
-import org.codehaus.groovy.runtime.powerassert.PowerAssertionError;
 import org.codehaus.groovy.tools.RootLoader;
 
 /**
@@ -67,16 +65,8 @@ class GroovyScriptInterpreter implements ScriptInterpreter {
                     new Binding(globalVariables),
                     new CompilerConfiguration(CompilerConfiguration.DEFAULT));
 
-            try {
-                return interpreter.evaluate(script);
-            } catch (ThreadDeath e) {
-                throw e;
-            } catch (PowerAssertionError e) {
-                throw new ScriptEvaluationException("Assertion Error", e);
-            } catch (Throwable e) {
-                throw new ScriptEvaluationException(e);
-            }
-        } catch (IOException e) {
+            return interpreter.evaluate(script);
+        } catch (Throwable e) {
             throw new ScriptEvaluationException(e);
         } finally {
             System.setErr(origErr);