HADOOP-12795. KMS does not log detailed stack trace for unexpected errors. Contributed by Chris Nauroth.

This commit is contained in:
cnauroth 2016-02-11 16:52:58 -08:00
parent 23f937e3b7
commit 70c756d35e
2 changed files with 5 additions and 0 deletions

View File

@ -1695,6 +1695,9 @@ Release 2.8.0 - UNRELEASED
"hadoop.workaround.non.threadsafe.getpwuid" is different between
core-default.xml and NativeIO.java (Akira AJISAKA via cmccabe)
HADOOP-12795. KMS does not log detailed stack trace for unexpected errors.
(cnauroth)
Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -86,12 +86,14 @@ public class KMSExceptionsProvider implements ExceptionMapper<Exception> {
status = Response.Status.FORBIDDEN;
} else if (exception instanceof IOException) {
status = Response.Status.INTERNAL_SERVER_ERROR;
log(status, throwable);
} else if (exception instanceof UnsupportedOperationException) {
status = Response.Status.BAD_REQUEST;
} else if (exception instanceof IllegalArgumentException) {
status = Response.Status.BAD_REQUEST;
} else {
status = Response.Status.INTERNAL_SERVER_ERROR;
log(status, throwable);
}
if (doAudit) {
KMSWebApp.getKMSAudit().error(KMSMDCFilter.getUgi(),