@@ -104,14 +104,14 @@ public String format(String raw) throws Exception {
104
104
* Eclipse Groovy formatter does not signal problems by its return value, but by logging errors.
105
105
*/
106
106
private static final class GroovyErrorListener implements ILogListener , IGroovyLogger {
107
- private final List <String > errors ;
107
+ private final List <Throwable > errors ;
108
108
109
109
public GroovyErrorListener () {
110
110
/*
111
111
* We need a synchronized list here, in case multiple instantiations
112
112
* run in parallel.
113
113
*/
114
- errors = Collections .synchronizedList (new ArrayList <String >());
114
+ errors = Collections .synchronizedList (new ArrayList <>());
115
115
ILog groovyLogger = GroovyCoreActivator .getDefault ().getLog ();
116
116
groovyLogger .addLogListener (this );
117
117
synchronized (GroovyLogManager .manager ) {
@@ -121,7 +121,7 @@ public GroovyErrorListener() {
121
121
122
122
@ Override
123
123
public void logging (final IStatus status , final String plugin ) {
124
- errors .add (status .getMessage ());
124
+ errors .add (status .getException ());
125
125
}
126
126
127
127
public boolean errorsDetected () {
@@ -141,9 +141,10 @@ public String toString() {
141
141
} else if (0 == errors .size ()) {
142
142
string .append ("Step sucesfully executed." );
143
143
}
144
- for (String error : errors ) {
144
+ for (Throwable error : errors ) {
145
+ error .printStackTrace ();
145
146
string .append (System .lineSeparator ());
146
- string .append (error );
147
+ string .append (error . getMessage () );
147
148
}
148
149
149
150
return string .toString ();
@@ -162,7 +163,11 @@ public boolean isCategoryEnabled(TraceCategory cat) {
162
163
163
164
@ Override
164
165
public void log (TraceCategory arg0 , String arg1 ) {
165
- errors .add (arg1 );
166
+ try {
167
+ throw new RuntimeException (arg1 );
168
+ } catch (RuntimeException e ) {
169
+ errors .add (e );
170
+ }
166
171
}
167
172
}
168
173
0 commit comments