include e as inner exception

This commit is contained in:
Prabhjyot Singh 2017-04-26 12:06:07 +05:30
parent c180f5ce2f
commit e2bdbb2ad9
2 changed files with 6 additions and 8 deletions

View file

@ -367,10 +367,7 @@ public class JDBCInterpreter extends Interpreter {
user, UserGroupInformation.getCurrentUser());
} catch (Exception e) {
logger.error("Error in getCurrentUser", e);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(e.getMessage()).append("\n");
stringBuilder.append(e.getCause());
throw new InterpreterException(stringBuilder.toString());
throw new InterpreterException("Error in getCurrentUser", e);
}
final String poolKey = propertyKey;
@ -383,10 +380,7 @@ public class JDBCInterpreter extends Interpreter {
});
} catch (Exception e) {
logger.error("Error in doAs", e);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(e.getMessage()).append("\n");
stringBuilder.append(e.getCause());
throw new InterpreterException(stringBuilder.toString());
throw new InterpreterException("Error in doAs", e);
}
}
break;

View file

@ -31,4 +31,8 @@ public class InterpreterException extends RuntimeException {
super(m);
}
public InterpreterException(String msg, Throwable t) {
super(msg, t);
}
}