You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Slawomir Jaranowski (Jira)" <ji...@apache.org> on 2020/06/02 18:28:00 UTC
[jira] [Created] (MSHARED-914) Detailed message from failed script
evaluation should be propagated
Slawomir Jaranowski created MSHARED-914:
-------------------------------------------
Summary: Detailed message from failed script evaluation should be propagated
Key: MSHARED-914
URL: https://issues.apache.org/jira/browse/MSHARED-914
Project: Maven Shared Components
Issue Type: Improvement
Components: maven-script-interpreter
Reporter: Slawomir Jaranowski
In class ScriptRunner when exception occur during script evaluate message from cause exception is propagated to generated exception.
For groovy we have many details in message so if client library logs message from exception it is redundant.
This datailed is stored in log file from execution. So if somebody also print content of logs, as maven-infoker with streamLogs, we have duplicated messages.
This details is stored in log file from execution. So if somebody also print content of logs, as maven-invoker-plugin does with streamsLogs options, we have duplicate messages.
Code to change:
{code:java}
catch ( ScriptEvaluationException e )
{
Throwable t = ( e.getCause() != null ) ? e.getCause() : e;
String msg = ( t.getMessage() != null ) ? t.getMessage() : t.toString();
if ( LOG.isDebugEnabled() )
{
String errorMessage = "Error evaluating " + scriptDescription + " " + scriptFile.getPath() + ", " + t;
LOG.debug( errorMessage, t );
}
if ( logger != null )
{
t.printStackTrace( logger.getPrintStream() );
}
if ( failOnException )
{
throw new RunFailureException( "The " + scriptDescription + " did not succeed. " + msg, stage );
}
else
{
throw new RunErrorException( "The " + scriptDescription + " did not succeed. " + msg, stage, t );
}
} {code}
{{msg}} variable and her usage should be removed.
This resolve MINVOKER-265
--
This message was sent by Atlassian Jira
(v8.3.4#803005)