better message in CompilationException
This commit is contained in:
@@ -62,11 +62,13 @@ public class CompilationException extends RuntimeException {
|
|||||||
|
|
||||||
private String where() {
|
private String where() {
|
||||||
Throwable cause = getCause();
|
Throwable cause = getCause();
|
||||||
if (cause != null && cause.getStackTrace().length > 0) {
|
Throwable throwable = cause != null ? cause : this;
|
||||||
return cause.getStackTrace()[0].getFileName() + ":" + cause.getStackTrace()[0].getLineNumber();
|
StackTraceElement[] stackTrace = throwable.getStackTrace();
|
||||||
|
if (stackTrace != null && stackTrace.length > 0) {
|
||||||
|
return stackTrace[0].getFileName() + ":" + stackTrace[0].getLineNumber();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return "far away in cyberspace";
|
return "unknown";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user