Browse Source

HUE-3650 [beeswax] Notify of caught errors in the watch logs process

Enrico Berti 9 năm trước cách đây
mục cha
commit
7ca5d14
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 8 1
      apps/beeswax/src/beeswax/static/beeswax/js/beeswax.vm.js

+ 8 - 1
apps/beeswax/src/beeswax/static/beeswax/js/beeswax.vm.js

@@ -639,7 +639,14 @@ function BeeswaxViewModel(server, assistHelper) {
       dataType: 'json',
       type: 'POST',
       success: function(data) {
-        $(document).trigger('watched.query', data);
+        if (data.status != 0) {
+          self.setErrors(data.message, data.errors);
+          self.design.isRunning(false);
+          $(document).trigger('error.query');
+        }
+        else {
+          $(document).trigger('watched.query', data);
+        }
       },
       error: function(jqXHR, status, errorThrown) {
         self.design.isRunning(false);