diff options
Diffstat (limited to 'exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java')
-rw-r--r-- | exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java index e88b57cb4..86e3ddeb4 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java @@ -376,8 +376,13 @@ public class ProfileResources { @Path("/profiles/{queryid}") @Produces(MediaType.TEXT_HTML) public Viewable getProfile(@PathParam("queryid") String queryId){ - ProfileWrapper wrapper = new ProfileWrapper(getQueryProfile(queryId), work.getContext().getConfig()); - return ViewableWithPermissions.create(authEnabled.get(), "/rest/profile/profile.ftl", sc, wrapper); + try { + ProfileWrapper wrapper = new ProfileWrapper(getQueryProfile(queryId), work.getContext().getConfig()); + return ViewableWithPermissions.create(authEnabled.get(), "/rest/profile/profile.ftl", sc, wrapper); + } catch (Exception | Error e) { + logger.error("Exception was thrown when fetching profile {} :\n{}", queryId, e); + return ViewableWithPermissions.create(authEnabled.get(), "/rest/errorMessage.ftl", sc, e); + } } @SuppressWarnings("resource") |