瀏覽代碼

[pig] Report error when submittion fails

Also put the error in the Hue logs
Romain Rigaux 12 年之前
父節點
當前提交
84e7dd2
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 2 0
      apps/oozie/src/oozie/views/editor.py
  2. 3 1
      apps/pig/static/js/pig.ko.js

+ 2 - 0
apps/oozie/src/oozie/views/editor.py

@@ -33,6 +33,7 @@ from django.utils.translation import ugettext as _, activate as activate_transla
 
 from desktop.lib.django_util import render, extract_field_data
 from desktop.lib.exceptions_renderable import PopupException
+from desktop.lib.i18n import smart_str
 from desktop.lib.rest.http_client import RestException
 from hadoop.fs.exceptions import WebHdfsException
 from liboozie.submittion import Submission
@@ -335,6 +336,7 @@ def _submit_workflow(user, fs, workflow, mapping):
     detail = ex._headers.get('oozie-error-message', ex)
     if 'urlopen error' in str(detail):
       detail = '%s: %s' % (_('The Oozie server is not running'), detail)
+    LOG.error(smart_str(detail))
     raise PopupException(_("Error submitting workflow %s") % (workflow,), detail=detail)
 
   return redirect(reverse('oozie:list_oozie_workflow', kwargs={'job_id': job_id}))

+ 3 - 1
apps/pig/static/js/pig.ko.js

@@ -501,7 +501,9 @@ var PigViewModel = function (props) {
           $(document).trigger("showLogs");
           self.updateScripts();
           $("#submitModal").modal("hide");
-        }, "json");
+        }, "json").fail( function(xhr, textStatus, errorThrown) {
+          $(document).trigger("error", xhr.responseText);
+        });
   }
 
   function callStop(script) {