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:
parent
54dc17ce2f
commit
362ae5143c
|
@ -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
|
||||
|
|
|
@ -621,7 +621,7 @@ abstract public class Shell {
|
|||
* 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 @@ abstract public class Shell {
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue