mirror of https://github.com/sbt/sbt.git
Updated ForkError.getMessage() to include exception's original name.
This commit is contained in:
parent
d63775451c
commit
cd3af2f0cd
|
|
@ -0,0 +1,10 @@
|
||||||
|
[@kamilkloch]: https://github.com/kamilkloch
|
||||||
|
[2028]: https://github.com/sbt/sbt/issues/2028
|
||||||
|
|
||||||
|
### Changes with compatibility implications
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Update ForkError.getMessage() to include exception's original name. [#2028][2028] by [@kamilkloch][@kamilkloch]
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
@ -95,13 +95,15 @@ public class ForkMain {
|
||||||
|
|
||||||
static class ForkError extends Exception {
|
static class ForkError extends Exception {
|
||||||
private String originalMessage;
|
private String originalMessage;
|
||||||
|
private String originalName;
|
||||||
private ForkError cause;
|
private ForkError cause;
|
||||||
ForkError(Throwable t) {
|
ForkError(Throwable t) {
|
||||||
originalMessage = t.getMessage();
|
originalMessage = t.getMessage();
|
||||||
|
originalName = t.getClass().getName();
|
||||||
setStackTrace(t.getStackTrace());
|
setStackTrace(t.getStackTrace());
|
||||||
if (t.getCause() != null) cause = new ForkError(t.getCause());
|
if (t.getCause() != null) cause = new ForkError(t.getCause());
|
||||||
}
|
}
|
||||||
public String getMessage() { return originalMessage; }
|
public String getMessage() { return originalName + ": " + originalMessage; }
|
||||||
public Exception getCause() { return cause; }
|
public Exception getCause() { return cause; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue