HADOOP-10312 Shell.ExitCodeException to have more useful toString

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1607591 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steve Loughran 2014-07-03 11:28:02 +00:00
parent 54dc17ce2f
commit 362ae5143c
2 changed files with 13 additions and 1 deletions

View File

@ -685,6 +685,8 @@ Release 2.5.0 - UNRELEASED
HADOOP-10710. hadoop.auth cookie is not properly constructed according to
RFC2109. (Juan Yu via tucu)
HADOOP-10312 Shell.ExitCodeException to have more useful toString (stevel)
Release 2.4.1 - 2014-06-23
INCOMPATIBLE CHANGES

View File

@ -621,7 +621,7 @@ public int getExitCode() {
* This is an IOException with exit code added.
*/
public static class ExitCodeException extends IOException {
int exitCode;
private final int exitCode;
public ExitCodeException(int exitCode, String message) {
super(message);
@ -631,6 +631,16 @@ public ExitCodeException(int exitCode, String message) {
public int getExitCode() {
return exitCode;
}
@Override
public String toString() {
final StringBuilder sb =
new StringBuilder("ExitCodeException ");
sb.append("exitCode=").append(exitCode)
.append(": ");
sb.append(super.getMessage());
return sb.toString();
}
}
/**