diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java index e55eda93778..61c42b80887 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/IpcException.java @@ -26,9 +26,8 @@ */ public class IpcException extends IOException { private static final long serialVersionUID = 1L; - - final String errMsg; + public IpcException(final String err) { - errMsg = err; + super(err); } } diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java index 154877bf327..79fbf827922 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java @@ -1948,7 +1948,7 @@ private void doSaslReply(Message message) throws IOException { private void doSaslReply(Exception ioe) throws IOException { setupResponse(authFailedCall, RpcStatusProto.FATAL, RpcErrorCodeProto.FATAL_UNAUTHORIZED, - null, ioe.getClass().getName(), ioe.getLocalizedMessage()); + null, ioe.getClass().getName(), ioe.toString()); sendResponse(authFailedCall); } @@ -2307,7 +2307,8 @@ private void processOneRpc(ByteBuffer bb) final RpcCall call = new RpcCall(this, callId, retry); setupResponse(call, rse.getRpcStatusProto(), rse.getRpcErrorCodeProto(), null, - t.getClass().getName(), t.getMessage()); + t.getClass().getName(), + t.getMessage() != null ? t.getMessage() : t.toString()); sendResponse(call); } }