Explorar o código

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

Enrico Berti %!s(int64=9) %!d(string=hai) anos
pai
achega
7ca5d14
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  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);