107 |
private Exception exception; |
private Exception exception; |
108 |
|
|
109 |
/** |
/** |
110 |
|
* This is the caught Throwable thrown in the <code>run()</code> method. |
111 |
|
*/ |
112 |
|
private Throwable throwable; |
113 |
|
|
114 |
|
/** |
115 |
* The timestamp when this event was created. |
* The timestamp when this event was created. |
116 |
* |
* |
117 |
* @see #getWhen() |
* @see #getWhen() |
188 |
{ |
{ |
189 |
runnable.run(); |
runnable.run(); |
190 |
} |
} |
191 |
catch (Exception e) |
catch (Throwable t) |
192 |
{ |
{ |
193 |
exception = e; |
throwable = t; |
194 |
|
if (t instanceof Exception) |
195 |
|
exception = (Exception)t; |
196 |
} |
} |
197 |
else |
else |
198 |
runnable.run(); |
runnable.run(); |
218 |
} |
} |
219 |
|
|
220 |
/** |
/** |
221 |
|
* Returns a throwable caught while executing the Runnable's run() method. |
222 |
|
* Null if none was thrown or if this InvocationEvent doesn't catch |
223 |
|
* throwables. |
224 |
|
* @return the caught Throwable |
225 |
|
*/ |
226 |
|
public Throwable getThrowable() |
227 |
|
{ |
228 |
|
return throwable; |
229 |
|
} |
230 |
|
|
231 |
|
/** |
232 |
* Gets the timestamp of when this event was created. |
* Gets the timestamp of when this event was created. |
233 |
* |
* |
234 |
* @return the timestamp of this event |
* @return the timestamp of this event |