From 6f1c03cb668c9a2ff0ecd57e95939406a36929bb Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 28 Jul 2017 16:26:47 +0200 Subject: [PATCH] #39 Handle analyzer launch fail --- ui/app/scripts/controllers.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/app/scripts/controllers.js b/ui/app/scripts/controllers.js index 25baed434..9385bae28 100644 --- a/ui/app/scripts/controllers.js +++ b/ui/app/scripts/controllers.js @@ -48,6 +48,10 @@ angular.module('cortex') _.each(response, function(resp) { NotificationService.success(resp.data.analyzerId + ' started successfully on ' + (resp.data.artifact.data || resp.data.artifact.attributes.filename)); }); + }).catch(function(err) { + if(err != 'cancel') { + NotificationService.error(('An error occurred: ' + err.statusText) || 'An unexpected error occurred'); + } }); }); }; @@ -83,6 +87,10 @@ angular.module('cortex') }).then(function (response) { $state.go('jobs'); NotificationService.success(response.data.analyzerId + ' started successfully on ' + response.data.artifact.data); + }).catch(function(err) { + if(err != 'cancel') { + NotificationService.error(('An error occurred: ' + err.statusText) || 'An unexpected error occurred'); + } }); };