You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Sylwester Lachiewicz (Jira)" <ji...@apache.org> on 2020/07/15 17:22:00 UTC

[jira] [Closed] (MSHARED-914) Detailed message from failed script evaluation shouldn't be propagated

     [ https://issues.apache.org/jira/browse/MSHARED-914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sylwester Lachiewicz closed MSHARED-914.
----------------------------------------
    Resolution: Fixed

> Detailed message from failed script evaluation shouldn't 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
>            Assignee: Sylwester Lachiewicz
>            Priority: Major
>             Fix For: maven-script-interpreter-1.3
>
>
> 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)