Fix issue #203 - errors in Util.exception when no trace present.
This commit is contained in:
parent
bd479ba083
commit
d6e29b3f29
@ -68,6 +68,9 @@ public class Util
|
|||||||
*/
|
*/
|
||||||
public static String exception(Throwable t)
|
public static String exception(Throwable t)
|
||||||
{
|
{
|
||||||
return t.getClass().getSimpleName() + " : " + t.getMessage() + " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber();
|
// TODO: We should use clear manually written exceptions
|
||||||
|
StackTraceElement[] trace = t.getStackTrace();
|
||||||
|
return t.getClass().getSimpleName() + " : " + t.getMessage()
|
||||||
|
+ ( ( trace.length > 0 ) ? " @ " + t.getStackTrace()[0].getClassName() + ":" + t.getStackTrace()[0].getLineNumber() : "" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user