Updated ForkError.getMessage() to include exception's original name.

This commit is contained in:
Kamil Kloch 2015-05-20 15:19:00 +02:00
parent d63775451c
commit cd3af2f0cd
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -95,13 +95,15 @@ public class ForkMain {
static class ForkError extends Exception {
private String originalMessage;
private String originalName;
private ForkError cause;
ForkError(Throwable t) {
originalMessage = t.getMessage();
originalName = t.getClass().getName();
setStackTrace(t.getStackTrace());
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; }
}