Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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:
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 ); } }
msg variable and her usage should be removed.
This resolve MINVOKER-265
Attachments
Issue Links
- fixes
-
MINVOKER-265 option 'streamLogs' does not work properly for logs from groovy intepreter
- Closed
- links to