Ver código fonte

HUE-2855 [oozie] Show error on dashboard when server is down

krish 10 anos atrás
pai
commit
297ffbfd9b

+ 2 - 0
apps/oozie/src/oozie/templates/dashboard/list_oozie_bundles.mako

@@ -449,6 +449,8 @@ ${layout.menubar(section='bundles', dashboard=True)}
         numRunning = data.jobs.length;
 
         window.setTimeout(refreshRunning, 20000);
+      }).fail(function (xhr, textStatus, errorThrown) {
+        $(document).trigger("error", xhr.responseJSON['detail']);
       });
     }
 

+ 2 - 0
apps/oozie/src/oozie/templates/dashboard/list_oozie_coordinators.mako

@@ -503,6 +503,8 @@ ${layout.menubar(section='coordinators', dashboard=True)}
         }
         numRunning = data.jobs.length;
         window.setTimeout(refreshRunning, 20000);
+      }).fail(function (xhr, textStatus, errorThrown) {
+        $(document).trigger("error", xhr.responseJSON['detail']);
       });
     }
 

+ 2 - 0
apps/oozie/src/oozie/templates/dashboard/list_oozie_workflows.mako

@@ -499,6 +499,8 @@ ${ layout.menubar(section='workflows', dashboard=True) }
 
         runningTable.fnDraw();
         runningTimeout = window.setTimeout(refreshRunning, 5000);
+      }).fail(function (xhr, textStatus, errorThrown) {
+        $(document).trigger("error", xhr.responseJSON['detail']);
       });
     }
 

+ 2 - 2
apps/oozie/src/oozie/views/dashboard.py

@@ -168,8 +168,8 @@ def show_oozie_error(view_func):
       LOG.exception("Error communicating with Oozie in %s", view_func.__name__)
 
       detail = ex._headers.get('oozie-error-message', ex)
-      if 'Max retries exceeded with url' in str(detail):
-        detail = '%s: %s' % (_('The Oozie server is not running'), detail)
+      if 'Max retries exceeded with url' in str(detail) or 'Connection refused' in str(detail):
+        detail = _('The Oozie server is not running')
       raise PopupException(_('An error occurred with Oozie.'), detail=detail)
   return wraps(view_func)(decorate)