From 76aa981074f49b65e77d6599ce08b003800e7744 Mon Sep 17 00:00:00 2001 From: annag Date: Tue, 18 Apr 2017 15:13:31 +0530 Subject: [PATCH] Minor bug fixes in exception and UI --- app/controllers/api/v1/Web.java | 17 ++++++++++++++--- app/views/newmain.scala.html | 1 + web/app/adapters/application.js | 3 ++- web/app/templates/application.hbs | 1 + 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/v1/Web.java b/app/controllers/api/v1/Web.java index 979db82aa..bbf182c19 100644 --- a/app/controllers/api/v1/Web.java +++ b/app/controllers/api/v1/Web.java @@ -1732,7 +1732,7 @@ public static Result restExceptionStatuses () { Set schedulersConfigured = InfoExtractor.getSchedulersConfiguredForException(); JsonObject exception = new JsonObject(); if(schedulersConfigured.isEmpty()) { - exception.addProperty(JsonKeys.EXCEPTION_ENABLED, "true"); + exception.addProperty(JsonKeys.EXCEPTION_ENABLED, "false"); exception.add(JsonKeys.SCHEDULERS, new JsonArray()); exception.addProperty(JsonKeys.ID, "exception-status"); @@ -1784,8 +1784,19 @@ public static Result restExceptions() throws URISyntaxException, MalformedURLExc parent.add("workflow-exceptions", new JsonArray()); return notFound(new Gson().toJson(parent)); } else { - ExceptionFinder expGen = new ExceptionFinder(url, scheduler); - HadoopException flowException = expGen.getExceptions(); + ExceptionFinder expGen; + HadoopException flowException; + + try { + expGen = new ExceptionFinder(url, scheduler); + flowException = expGen.getExceptions(); + } catch (RuntimeException e) { + parent.add("workflow-exceptions", new JsonArray()); + return status(500,"Unexpected error occured"); + } catch (Exception e) { + parent.add("workflow-exceptions", new JsonArray()); + return status(500,"Unexpected error occured"); + } JsonArray jobsArray = new JsonArray(); diff --git a/app/views/newmain.scala.html b/app/views/newmain.scala.html index 426a67b6b..d0c8d2311 100644 --- a/app/views/newmain.scala.html +++ b/app/views/newmain.scala.html @@ -65,6 +65,7 @@
  • Exceptions
  • JobHistory
  • FlowHistory
  • +
  • User details
  • Help
  • diff --git a/web/app/adapters/application.js b/web/app/adapters/application.js index a01c937a7..ca48a8549 100644 --- a/web/app/adapters/application.js +++ b/web/app/adapters/application.js @@ -18,8 +18,9 @@ import DS from 'ember-data'; import Ember from 'ember'; export default DS.JSONAPIAdapter.extend({ - namespace: 'rest', + namespace: 'rest' }); + export default DS.RESTAdapter.extend({ namespace: 'rest', pathForType: function (type) { diff --git a/web/app/templates/application.hbs b/web/app/templates/application.hbs index 986c45082..0fc86f368 100644 --- a/web/app/templates/application.hbs +++ b/web/app/templates/application.hbs @@ -39,6 +39,7 @@
  • {{#link-to "workflow-exceptions" (query-params workflowId=null)}}Exceptions{{/link-to}}
  • JobHistory
  • FlowHistory
  • +
  • {{#link-to "user-details"}}User details{{/link-to}}
  • Help