HADOOP-6686. Remove redundant exception class name from the exception message for the exceptions thrown at RPC client. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@937183 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Suresh Srinivas 2010-04-23 08:05:30 +00:00
parent 1e82194428
commit 50f24d774e
3 changed files with 13 additions and 6 deletions

View File

@ -7,6 +7,9 @@ Trunk (unreleased changes)
HADOOP-6299. Reimplement the UserGroupInformation to use the OS
specific and Kerberos JAAS login. (omalley)
HADOOP-6686. Remove redundant exception class name from the exception
message for the exceptions thrown at RPC client. (suresh)
NEW FEATURES
HADOOP-6284. Add a new parameter, HADOOP_JAVA_PLATFORM_OPTS, to

View File

@ -88,12 +88,7 @@ public class RemoteException extends IOException {
throws Exception {
Constructor<? extends IOException> cn = cls.getConstructor(String.class);
cn.setAccessible(true);
String firstLine = this.getMessage();
int eol = firstLine.indexOf('\n');
if (eol>=0) {
firstLine = firstLine.substring(0, eol);
}
IOException ex = cn.newInstance(firstLine);
IOException ex = cn.newInstance(this.getMessage());
ex.initCause(this);
return ex;
}
@ -117,4 +112,8 @@ public class RemoteException extends IOException {
return new RemoteException(attrs.getValue("class"),
attrs.getValue("message"));
}
public String toString() {
return className + ": " + getMessage();
}
}

View File

@ -1276,6 +1276,11 @@ public abstract class Server {
LOG.info(getName()+", call "+call+": error: " + e, e);
errorClass = e.getClass().getName();
error = StringUtils.stringifyException(e);
// Remove redundant error class name from the beginning of the stack trace
String exceptionHdr = errorClass + ": ";
if (error.startsWith(exceptionHdr)) {
error = error.substring(exceptionHdr.length());
}
}
CurCall.set(null);
synchronized (call.connection.responseQueue) {