From a8ad6b61719127aa1b3b4d210f7c589b72cf16fa Mon Sep 17 00:00:00 2001 From: Junping Du Date: Thu, 17 Nov 2016 16:55:39 -0800 Subject: [PATCH] YARN-3538. TimelineWebService doesn't catch runtime exception. Contributed by Steve Loughran and Tsuyoshi Ozawa. (cherry picked from commit f05a9ceb4a9623517aa1c8d995805e26ae1bde5a) --- .../yarn/server/timeline/webapp/TimelineWebServices.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/webapp/TimelineWebServices.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/webapp/TimelineWebServices.java index 5c801326a9d..48ca300d685 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/webapp/TimelineWebServices.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/timeline/webapp/TimelineWebServices.java @@ -261,6 +261,10 @@ public class TimelineWebServices { // The user doesn't have the access to override the existing domain. LOG.error(e.getMessage(), e); throw new ForbiddenException(e); + } catch (RuntimeException e) { + LOG.error("Error putting domain", e); + throw new WebApplicationException(e, + Response.Status.INTERNAL_SERVER_ERROR); } catch (IOException e) { LOG.error("Error putting domain", e); throw new WebApplicationException(e,