Ver código fonte

HUE-3757 [oozie] Better error messages when deleting read only document in editor

Romain Rigaux 9 anos atrás
pai
commit
3e29155270

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/list_editor_bundles.mako

@@ -207,7 +207,7 @@ ${ commonimportexport(request) | n,unicode }
         window.location.reload();
         $('#deleteWf').modal('hide');
       }).fail(function (xhr, textStatus, errorThrown) {
-        $(document).trigger("error", xhr.responseText);
+        $(document).trigger("error", xhr.status == 500 ? JSON.parse(xhr.responseText).message : xhr.responseText);
       });
     };
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/list_editor_coordinators.mako

@@ -205,7 +205,7 @@ ${ commonimportexport(request) | n,unicode }
       }, function() {
         window.location.reload();
       }).fail(function (xhr, textStatus, errorThrown) {
-        $(document).trigger("error", xhr.responseText);
+        $(document).trigger("error", xhr.status == 500 ? JSON.parse(xhr.responseText).message : xhr.responseText);
       });
     };
 

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/list_editor_workflows.mako

@@ -207,7 +207,7 @@ ${ commonimportexport(request) | n,unicode }
         window.location.reload();
         $('#deleteWf').modal('hide');
       }).fail(function (xhr, textStatus, errorThrown) {
-        $(document).trigger("error", xhr.responseText);
+        $(document).trigger("error", xhr.status == 500 ? JSON.parse(xhr.responseText).message : xhr.responseText);
       });
     };