You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2018/05/10 11:48:38 UTC

[04/17] flink git commit: [FLINK-8912][WebUI] Update error handling for flip6

[FLINK-8912][WebUI] Update error handling for flip6

This closes #5907.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/a6cdc208
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/a6cdc208
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/a6cdc208

Branch: refs/heads/master
Commit: a6cdc2085a3ea3d66271ec63f2224bcadbd5d5d7
Parents: 3474dbb
Author: zentol <ch...@apache.org>
Authored: Mon May 7 09:06:15 2018 +0200
Committer: zentol <ch...@apache.org>
Committed: Thu May 10 08:26:13 2018 +0200

----------------------------------------------------------------------
 .../scripts/modules/submit/submit.ctrl.coffee   | 20 +++++++++++++++++---
 .../scripts/modules/submit/submit.svc.coffee    | 10 ++++++++--
 2 files changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/a6cdc208/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.ctrl.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.ctrl.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.ctrl.coffee
index bb1b1ff..baf8396 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.ctrl.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.ctrl.coffee
@@ -23,7 +23,10 @@ angular.module('flinkApp')
   $scope.loadList = () ->
     JobSubmitService.loadJarList().then (data) ->
       $scope.address = data.address
-      $scope.noaccess = data.error
+      if data.error?
+        $scope.noaccess = data.error
+      else if data.errors?
+        $scope.noaccess = data.errors[0]
       $scope.jars = data.files
 
   $scope.defaultState = () ->
@@ -67,6 +70,8 @@ angular.module('flinkApp')
       angular.element(event.currentTarget).removeClass("fa-spin fa-spinner").addClass("fa-remove")
       if data.error?
         alert(data.error)
+      else if data.errors?
+        alert(data.errors[0])
 
   $scope.loadEntryClass = (name) ->
     $scope.state['entry-class'] = name
@@ -96,7 +101,10 @@ angular.module('flinkApp')
       ).then (data) ->
         if action == $scope.state['action-time']
           $scope.state['plan-button'] = "Show Plan"
-          $scope.error = data.error
+          if data.error?
+            $scope.error = data.error
+          else if data.errors?
+            $scope.error = data.errors[0]
           $scope.plan = data.plan
       .catch (err) ->
         $scope.state['plan-button'] = "Show Plan"
@@ -132,7 +140,10 @@ angular.module('flinkApp')
       ).then (data) ->
         if action == $scope.state['action-time']
           $scope.state['submit-button'] = "Submit"
-          $scope.error = data.error
+          if data.error?
+            $scope.error = data.error
+          else if data.errors?
+            $scope.error = data.errors[0]
           if data.jobid?
             $state.go("single-job.plan.subtasks", {jobid: data.jobid})
       .catch (err) ->
@@ -191,6 +202,9 @@ angular.module('flinkApp')
           if response.error?
             $scope.uploader['error'] = response.error
             $scope.uploader['success'] = null
+          else if response.errors?
+            $scope.uploader['error'] = response.errors[0]
+            $scope.uploader['success'] = null
           else
             $scope.uploader['success'] = "Uploaded!"
       xhr.open("POST", flinkConfig.jobServer + "jars/upload")

http://git-wip-us.apache.org/repos/asf/flink/blob/a6cdc208/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.svc.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.svc.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.svc.coffee
index 26dd7ef..989bdba 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.svc.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/submit/submit.svc.coffee
@@ -45,7 +45,10 @@ angular.module('flinkApp')
     .success (data, status, headers, config) ->
       deferred.resolve(data)
     .error (err) ->
-      deferred.reject(err)
+      if err.errors?
+        deferred.reject(err.errors[0])
+      else
+        deferred.reject(err)
 
     deferred.promise
 
@@ -56,7 +59,10 @@ angular.module('flinkApp')
     .success (data, status, headers, config) ->
       deferred.resolve(data)
     .error (err) ->
-      deferred.reject(err)
+      if err.errors?
+        deferred.reject(err.errors[0])
+      else
+        deferred.reject(err)
 
     deferred.promise