Repository: ambari Updated Branches: refs/heads/branch-1.7.0 f1af2c5ea -> 8128f19a8
AMBARI-8058. Slider View: view initialization errors should be more descriptive (srimanth) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8128f19a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8128f19a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8128f19a Branch: refs/heads/branch-1.7.0 Commit: 8128f19a80c0f9ecafe3be07cd21cdd38e74fc31 Parents: f1af2c5 Author: Srimanth Gunturi <[email protected]> Authored: Thu Oct 30 20:00:27 2014 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Fri Oct 31 07:27:16 2014 -0700 ---------------------------------------------------------------------- .../ambari/view/slider/SliderAppsViewControllerImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/8128f19a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java index 6eebf9a..afeaab7 100644 --- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java +++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java @@ -286,9 +286,14 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController { new ViewStatus.Validation("Ambari cluster with ID [" + clusterName + "] was not found on Ambari server")); } - } catch (Throwable t) { - logger.warn("Exception determining view status", t); - status.getValidations().add(new ViewStatus.Validation(t.getMessage())); + } catch (Throwable e) { + logger.warn("Exception determining view status", e); + String message = e.getClass().getName() + ": " + e.getMessage(); + if (e instanceof RuntimeException && e.getCause() != null) { + message = e.getCause().getClass().getName() + ": " + e.getMessage(); + } + message = String.format("Unable to initialize Slider view: %s", message); + status.getValidations().add(new ViewStatus.Validation(message)); } } else { status
