Automatically change .error to .catch.

Use this script to change .error to .catch using this linux script:

    #!/bin/bash -ex
    #Run in awx/awx/ui/client/src
    FILES=`grep -l -R "\.error(\s*function\s*(data,\s*status)\s*{" . | xargs`
    sed -i "s/\.error(\s*function\s*(data,\s*status)\s*{/.catch(({data, status}) => {/g" $FILES

    FILES=`grep -l -R "\.error(this\.error\.bind(this))" . | xargs`
    sed -i "s/\.error(this\.error\.bind(this))/\.catch(this\.catch\.bind(this))/g" $FILES

    FILES=`grep -l -R "\.error(\s*function\s*(error)\s*{" . | xargs`
    sed -i "s/\.error(\s*function\s*(error)\s*{/.catch(({error}) => {/g" $FILES

    FILES=`grep -l -R "\.error(\s*function\s*(obj,\s*status)\s*{" . | xargs`
    sed -i "s/\.error(\s*function\s*(obj,\s*status)\s*{/.catch(({obj, status}) => {/g" $FILES

    FILES=`grep -l -R "\.error(\s*function\s*(res,\s*status)\s*{" . | xargs`
    sed -i "s/\.error(\s*function\s*(res,\s*status)\s*{/.catch(({res, status}) => {/g" $FILES

    FILES=`grep -l -R "\.error(\s*function\s*(msg,\s*code)\s*{" . | xargs`
    sed -i "s/\.error(\s*function\s*(msg,\s*code)\s*{/.catch(({msg, code}) => {/g" $FILES

    FILES=`grep -l -R "\.error(\s*function\s*()\s*{" . | xargs`
    sed -i "s/\.error(\s*function\s*()\s*{/.catch(() => {/g" $FILES
This commit is contained in:
Ben Thomasson
2017-10-04 13:24:00 -04:00
committed by Marliana Lara
parent 834e6c692c
commit 7d767f8f63
86 changed files with 163 additions and 163 deletions

View File

@@ -25,7 +25,7 @@ export default ['$scope', 'ListDefinition', 'Dataset', 'Wait', 'Rest', 'ProcessE
Wait('stop'); Wait('stop');
$state.go('.', null, {reload: true}); $state.go('.', null, {reload: true});
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Could not disassociate user from role. Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Could not disassociate user from role. Call to ' + url + ' failed. DELETE returned status: ' + status
@@ -58,7 +58,7 @@ export default ['$scope', 'ListDefinition', 'Dataset', 'Wait', 'Rest', 'ProcessE
Wait('stop'); Wait('stop');
$state.go('.', null, {reload: true}); $state.go('.', null, {reload: true});
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Could not disassociate team from role. Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Could not disassociate team from role. Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -57,7 +57,7 @@ export default
Wait('stop'); Wait('stop');
$state.go('.', null, { reload: true }); $state.go('.', null, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($rootScope, data, status, null, { ProcessErrors($rootScope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to remove access. Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Failed to remove access. Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -35,7 +35,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
deferred.resolve(returnData); deferred.resolve(returnData);
}) })
.error(function(error) { .catch(({error}) => {
deferred.reject(error); deferred.reject(error);
}); });
@@ -50,7 +50,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
.then(({data}) => { .then(({data}) => {
deferred.resolve(data); deferred.resolve(data);
}) })
.error(function(error) { .catch(({error}) => {
deferred.reject(error); deferred.reject(error);
}); });
@@ -64,7 +64,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
.then(({data}) => { .then(({data}) => {
deferred.resolve(data); deferred.resolve(data);
}) })
.error(function(error) { .catch(({error}) => {
deferred.reject(error); deferred.reject(error);
}); });

View File

@@ -103,7 +103,7 @@ export default ['Rest', 'Wait',
$state.go('credentialTypes.edit', { credential_type_id: data.id }, { reload: true }); $state.go('credentialTypes.edit', { credential_type_id: data.id }, { reload: true });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new credential type. PUT returned status: ' + status msg: 'Failed to add new credential type. PUT returned status: ' + status

View File

@@ -177,7 +177,7 @@ export default ['Rest', 'Wait',
$state.go($state.current, null, { reload: true }); $state.go($state.current, null, { reload: true });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new credential type. PUT returned status: ' + status msg: 'Failed to add new credential type. PUT returned status: ' + status

View File

@@ -75,7 +75,7 @@ export default ['$rootScope', '$scope', 'Wait', 'CredentialTypesList',
$state.go('.', reloadListStateParams, { reload: true }); $state.go('.', reloadListStateParams, { reload: true });
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -63,7 +63,7 @@ export default
ReturnToCaller(1); ReturnToCaller(1);
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
// TODO: hopefully this conditional error handling will to away in a future versions. The reason why we cannot // TODO: hopefully this conditional error handling will to away in a future versions. The reason why we cannot
// simply pass this error to ProcessErrors is because it will actually match the form element 'ssh_key_unlock' and show // simply pass this error to ProcessErrors is because it will actually match the form element 'ssh_key_unlock' and show
@@ -87,7 +87,7 @@ export default
Wait('stop'); Wait('stop');
$state.go($state.current, {}, {reload: true}); $state.go($state.current, {}, {reload: true});
}) })
.error(function (data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
ProcessErrors(scope, data, status, form, { ProcessErrors(scope, data, status, form, {
hdr: i18n._('Error!'), hdr: i18n._('Error!'),

View File

@@ -101,7 +101,7 @@ export default ['$scope', 'Rest', 'CredentialList', 'Prompt', 'ProcessErrors', '
} }
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -17,7 +17,7 @@ export default ['$scope', '$rootScope','Wait',
.then(({data}) => { .then(({data}) => {
$scope.dashboardData = data; $scope.dashboardData = data;
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard host graph data: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard host graph data: ' + status });
}); });
@@ -26,7 +26,7 @@ export default ['$scope', '$rootScope','Wait',
.then(({data}) => { .then(({data}) => {
$scope.dashboardJobsListData = data.results; $scope.dashboardJobsListData = data.results;
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard jobs list: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard jobs list: ' + status });
}); });
@@ -35,7 +35,7 @@ export default ['$scope', '$rootScope','Wait',
.then(({data}) => { .then(({data}) => {
$scope.dashboardJobTemplatesListData = data.results; $scope.dashboardJobTemplatesListData = data.results;
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard jobs list: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard jobs list: ' + status });
}); });
@@ -94,7 +94,7 @@ export default ['$scope', '$rootScope','Wait',
$scope.dashboardData = data; $scope.dashboardData = data;
$scope.$emit('dashboardReady', data); $scope.$emit('dashboardReady', data);
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard: ' + status });
}); });
Rest.setUrl(GetBasePath("unified_jobs") + "?order_by=-finished&page_size=5&finished__isnull=false&type=workflow_job,job"); Rest.setUrl(GetBasePath("unified_jobs") + "?order_by=-finished&page_size=5&finished__isnull=false&type=workflow_job,job");
@@ -103,7 +103,7 @@ export default ['$scope', '$rootScope','Wait',
data = data.results; data = data.results;
$scope.$emit('dashboardJobsListReady', data); $scope.$emit('dashboardJobsListReady', data);
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard jobs list: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard jobs list: ' + status });
}); });
Rest.setUrl(GetBasePath("unified_job_templates") + "?order_by=-last_job_run&page_size=5&last_job_run__isnull=false&type=workflow_job_template,job_template"); Rest.setUrl(GetBasePath("unified_job_templates") + "?order_by=-last_job_run&page_size=5&last_job_run__isnull=false&type=workflow_job_template,job_template");
@@ -112,7 +112,7 @@ export default ['$scope', '$rootScope','Wait',
data = data.results; data = data.results;
$scope.$emit('dashboardJobTemplatesListReady', data); $scope.$emit('dashboardJobTemplatesListReady', data);
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard job templates list: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to get dashboard job templates list: ' + status });
}); });
}; };

View File

@@ -243,7 +243,7 @@ function adhocController($q, $scope, $stateParams,
Wait('stop'); Wait('stop');
$state.go('adHocJobStdout', {id: data.id}); $state.go('adHocJobStdout', {id: data.id});
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, adhocForm, { ProcessErrors($scope, data, status, adhocForm, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to launch adhoc command. POST ' + msg: 'Failed to launch adhoc command. POST ' +

View File

@@ -13,7 +13,7 @@ export default [ '$scope', 'Empty', 'Wait', 'GetBasePath', 'Rest', 'ProcessError
.then(({data}) => { .then(({data}) => {
$scope.generateTable(data, event); $scope.generateTable(data, event);
}) })
.error( function(data, status) { .catch(({data, status}) => {
ProcessErrors( $scope, data, status, null, { hdr: 'Error!', ProcessErrors( $scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + ' failed. GET returned: ' + status msg: 'Call to ' + url + ' failed. GET returned: ' + status
}); });

View File

@@ -88,7 +88,7 @@ function InventoriesList($scope,
.then(() => { .then(() => {
Wait('stop'); Wait('stop');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors( $scope, data, status, null, { hdr: 'Error!', ProcessErrors( $scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status
}); });

View File

@@ -9,7 +9,7 @@ export default [ '$scope', 'Wait', 'Empty', 'Rest', 'ProcessErrors', '$state',
.then(({data}) => { .then(({data}) => {
$scope.generateTable(data, event); $scope.generateTable(data, event);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors( $scope, data, status, null, { hdr: 'Error!', ProcessErrors( $scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + $scope.inventory.related.inventory_sources + ' failed. GET returned status: ' + status msg: 'Call to ' + $scope.inventory.related.inventory_sources + ' failed. GET returned status: ' + status
}); });

View File

@@ -69,7 +69,7 @@ export default
Wait('stop'); Wait('stop');
$state.go('.', null, {reload: true}); $state.go('.', null, {reload: true});
}) })
.error(function (data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Could not disassociate host from group. Call to ' + url + ' failed. DELETE returned status: ' + status }); msg: 'Could not disassociate host from group. Call to ' + url + ' failed. DELETE returned status: ' + status });

View File

@@ -42,7 +42,7 @@ export default ['$state', '$stateParams', '$scope', 'SourcesFormDefinition',
sync_inventory_file_select2(); sync_inventory_file_select2();
Wait('stop'); Wait('stop');
}) })
.error(function () { .catch(() => {
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info'); Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
Wait('stop'); Wait('stop');
}); });

View File

@@ -131,7 +131,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
sync_inventory_file_select2(); sync_inventory_file_select2();
Wait('stop'); Wait('stop');
}) })
.error(function () { .catch(() => {
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info'); Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
Wait('stop'); Wait('stop');
}); });

View File

@@ -32,7 +32,7 @@ export default
//Alert('Inventory Sync Cancelled', 'Request to cancel the sync process was submitted to the task manger. ' + //Alert('Inventory Sync Cancelled', 'Request to cancel the sync process was submitted to the task manger. ' +
// 'Click the <i class="fa fa-refresh fa-lg"></i> button to monitor the status.', 'alert-info'); // 'Click the <i class="fa fa-refresh fa-lg"></i> button to monitor the status.', 'alert-info');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + ' failed. POST status: ' + status msg: 'Call to ' + url + ' failed. POST status: ' + status
}); });
@@ -42,13 +42,13 @@ export default
Wait('stop'); Wait('stop');
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + ' failed. GET status: ' + status msg: 'Call to ' + url + ' failed. GET status: ' + status
}); });
}); });
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + inventory_source.url + ' failed. GET status: ' + status msg: 'Call to ' + inventory_source.url + ' failed. GET status: ' + status
}); });

View File

@@ -21,7 +21,7 @@ export default
scope.cloudCredentialRequired = false; scope.cloudCredentialRequired = false;
scope.$emit('sourceTypeOptionsReady'); scope.$emit('sourceTypeOptionsReady');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve options for inventory_sources.source. OPTIONS status: ' + status msg: 'Failed to retrieve options for inventory_sources.source. OPTIONS status: ' + status
}); });

View File

@@ -19,7 +19,7 @@ export default
$state.go('inventorySyncStdout', {id: update_id}); $state.go('inventorySyncStdout', {id: update_id});
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve inventory source: ' + inventory_source.url + msg: 'Failed to retrieve inventory source: ' + inventory_source.url +
' GET returned status: ' + status }); ' GET returned status: ' + status });

View File

@@ -24,7 +24,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
post: function(inventory_source){ post: function(inventory_source){
@@ -33,7 +33,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post(inventory_source) return Rest.post(inventory_source)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
put: function(inventory_source){ put: function(inventory_source){
@@ -42,7 +42,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.put(inventory_source) return Rest.put(inventory_source)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
delete: function(id){ delete: function(id){
@@ -51,7 +51,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.destroy() return Rest.destroy()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
options: function(){ options: function(){
@@ -59,7 +59,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.options() return Rest.options()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)); .catch(this.catch.bind(this));
}, },
getCredential: function(id){ getCredential: function(id){
Wait('start'); Wait('start');
@@ -67,7 +67,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
getInventorySource: function(params){ getInventorySource: function(params){
@@ -76,7 +76,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
putInventorySource: function(params, url){ putInventorySource: function(params, url){
@@ -85,7 +85,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.put(params) return Rest.put(params)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
// these relationship setters could be consolidated, but verbosity makes the operation feel more clear @ controller level // these relationship setters could be consolidated, but verbosity makes the operation feel more clear @ controller level
@@ -95,7 +95,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post(group) return Rest.post(group)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
disassociateGroup: function(group, parent){ disassociateGroup: function(group, parent){
@@ -104,7 +104,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1}) return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
promote: function(group, inventory){ promote: function(group, inventory){
@@ -113,7 +113,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1}) return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
encodeGroupBy(source, group_by){ encodeGroupBy(source, group_by){

View File

@@ -77,7 +77,7 @@ function SmartInventoryAdd($scope, $location,
}); });
}); });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new inventory. Post returned status: ' + status msg: 'Failed to add new inventory. Post returned status: ' + status

View File

@@ -90,7 +90,7 @@ function SmartInventoryEdit($scope, $location,
}); });
}); });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to update inventory. PUT returned status: ' + status msg: 'Failed to update inventory. PUT returned status: ' + status

View File

@@ -24,7 +24,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
post: function(group){ post: function(group){
@@ -33,7 +33,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post(group) return Rest.post(group)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
put: function(group){ put: function(group){
@@ -42,7 +42,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.put(group) return Rest.put(group)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
delete: function(id){ delete: function(id){
@@ -51,7 +51,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.destroy() return Rest.destroy()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
getCredential: function(id){ getCredential: function(id){
@@ -60,7 +60,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
getInventorySource: function(params){ getInventorySource: function(params){
@@ -69,7 +69,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
putInventorySource: function(params, url){ putInventorySource: function(params, url){
@@ -78,7 +78,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.put(params) return Rest.put(params)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
// these relationship setters could be consolidated, but verbosity makes the operation feel more clear @ controller level // these relationship setters could be consolidated, but verbosity makes the operation feel more clear @ controller level
@@ -88,7 +88,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post(group) return Rest.post(group)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
disassociateGroup: function(group, parent){ disassociateGroup: function(group, parent){
@@ -97,7 +97,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1}) return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
associateHost: function(host, target){ associateHost: function(host, target){
@@ -106,7 +106,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post(host) return Rest.post(host)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
disassociateHost: function(host, group){ disassociateHost: function(host, group){
@@ -115,7 +115,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post({id: host, disassociate: 1}) return Rest.post({id: host, disassociate: 1})
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
promote: function(group, inventory){ promote: function(group, inventory){
@@ -124,7 +124,7 @@ export default
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1}) return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
} }
}; };

View File

@@ -31,7 +31,7 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
post: function(host){ post: function(host){
@@ -40,7 +40,7 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.post(host) return Rest.post(host)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
put: function(host){ put: function(host){
@@ -49,7 +49,7 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.put(host) return Rest.put(host)
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
delete: function(id){ delete: function(id){
@@ -58,7 +58,7 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.destroy() return Rest.destroy()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
} }
}; };

View File

@@ -26,7 +26,7 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
getBreadcrumbs: function(groups){ getBreadcrumbs: function(groups){
@@ -37,7 +37,7 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)) .catch(this.catch.bind(this))
.finally(Wait('stop')); .finally(Wait('stop'));
}, },
rootHostsUrl: function(id){ rootHostsUrl: function(id){
@@ -61,21 +61,21 @@
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.options() return Rest.options()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)); .catch(this.catch.bind(this));
}, },
updateInventorySourcesGet: function(inventoryId) { updateInventorySourcesGet: function(inventoryId) {
this.url = GetBasePath('inventory') + inventoryId + '/update_inventory_sources'; this.url = GetBasePath('inventory') + inventoryId + '/update_inventory_sources';
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)); .catch(this.catch.bind(this));
}, },
getHost: function(inventoryId, hostId) { getHost: function(inventoryId, hostId) {
this.url = GetBasePath('inventory') + inventoryId + '/hosts?id=' + hostId; this.url = GetBasePath('inventory') + inventoryId + '/hosts?id=' + hostId;
Rest.setUrl(this.url); Rest.setUrl(this.url);
return Rest.get() return Rest.get()
.then(this.then.bind(this)) .then(this.then.bind(this))
.error(this.error.bind(this)); .catch(this.catch.bind(this));
} }
}; };
}]; }];

View File

@@ -47,7 +47,7 @@ export default ['Rest', 'Wait',
$state.go('inventoryScripts', null, { reload: true }); $state.go('inventoryScripts', null, { reload: true });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new inventory script. POST returned status: ' + status msg: 'Failed to add new inventory script. POST returned status: ' + status

View File

@@ -63,7 +63,7 @@ export default ['Rest', 'Wait',
$state.go('inventoryScripts', null, { reload: true }); $state.go('inventoryScripts', null, { reload: true });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new inventory script. PUT returned status: ' + status msg: 'Failed to add new inventory script. PUT returned status: ' + status

View File

@@ -65,7 +65,7 @@ export default ['$rootScope', '$scope', 'Wait', 'InventoryScriptsList',
$state.go('.', reloadListStateParams, { reload: true }); $state.go('.', reloadListStateParams, { reload: true });
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -94,7 +94,7 @@ export default {
countFinished: true}); countFinished: true});
} }
}) })
.error(function() { .catch(() => {
defer.resolve({val: { defer.resolve({val: {
ok: 0, ok: 0,
skipped: 0, skipped: 0,

View File

@@ -77,7 +77,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
val.resolve({results: data.results, val.resolve({results: data.results,
next: data.next}); next: data.next});
}) })
.error(function(obj, status) { .catch(({obj, status}) => {
ProcessErrors(null, obj, status, null, { ProcessErrors(null, obj, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: `Could not get job events. msg: `Could not get job events.
@@ -106,7 +106,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
$state.go('jobs'); $state.go('jobs');
}) })
.error(function(obj, status) { .catch(({obj, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors(null, obj, status, null, { ProcessErrors(null, obj, status, null, {
@@ -127,7 +127,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
}) })
.error(function(obj, status) { .catch(({obj, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors(null, obj, status, null, { ProcessErrors(null, obj, status, null, {
@@ -242,7 +242,7 @@ function ($q, Prompt, $filter, Wait, Rest, $state, ProcessErrors, InitiatePlaybo
.then(({data}) => { .then(({data}) => {
return data; return data;
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($rootScope, data, status, null, { hdr: 'Error!', ProcessErrors($rootScope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + '. GET returned: ' + status }); msg: 'Call to ' + url + '. GET returned: ' + status });
}); });

View File

@@ -62,7 +62,7 @@
.then(() => { .then(() => {
Wait('stop'); Wait('stop');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, ProcessErrors(scope, data, status,
null, { hdr: 'Error!', null, { hdr: 'Error!',
msg: 'Call to ' + url + msg: 'Call to ' + url +
@@ -92,7 +92,7 @@
$state.go('adHocJobStdout', {id: data.id}); $state.go('adHocJobStdout', {id: data.id});
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, { ProcessErrors(scope, data, status, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to launch adhoc command. POST ' + msg: 'Failed to launch adhoc command. POST ' +
@@ -148,7 +148,7 @@
scope.$emit('StartAdhocRun'); scope.$emit('StartAdhocRun');
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get job template details. GET returned status: ' + status }); msg: 'Failed to get job template details. GET returned status: ' + status });
}); });

View File

@@ -30,7 +30,7 @@ export default
}); });
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get job template details. GET returned status: ' + status }); msg: 'Failed to get job template details. GET returned status: ' + status });
}); });

View File

@@ -74,7 +74,7 @@ export default
return; return;
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, { hdr: 'Error!', ProcessErrors(scope, data, status, { hdr: 'Error!',
msg: 'Failed to retrieve organization: ' + $stateParams.id + '. GET status: ' + status }); msg: 'Failed to retrieve organization: ' + $stateParams.id + '. GET status: ' + status });
}); });

View File

@@ -63,7 +63,7 @@ export default
} }
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get inventory source ' + url + ' GET returned: ' + status }); msg: 'Failed to get inventory source ' + url + ' GET returned: ' + status });
}); });

View File

@@ -188,7 +188,7 @@ export default
$state.go('.', null, {reload: true}); $state.go('.', null, {reload: true});
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
let template_id = scope.job_template_id; let template_id = scope.job_template_id;
template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id); template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id);
ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'),
@@ -209,7 +209,7 @@ export default
} }
buildData(); buildData();
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, { hdr: i18n._('Error!'), ProcessErrors(scope, data, status, { hdr: i18n._('Error!'),
msg: i18n._('Failed to retrieve job template extra variables.') }); msg: i18n._('Failed to retrieve job template extra variables.') });
}); });

View File

@@ -59,7 +59,7 @@ export default
'alert-danger'); 'alert-danger');
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to lookup project ' + url + ' GET returned: ' + status }); msg: 'Failed to lookup project ' + url + ' GET returned: ' + status });
}); });

View File

@@ -311,7 +311,7 @@ export default
} }
initiateModal(); initiateModal();
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get job details. GET returned status: ' + status }); msg: 'Failed to get job details. GET returned status: ' + status });
}); });
@@ -324,7 +324,7 @@ export default
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to get job template details. GET returned status: ' + status }); msg: 'Failed to get job template details. GET returned status: ' + status });
}); });

View File

@@ -52,7 +52,7 @@
Wait('stop'); Wait('stop');
} }
}) })
.error(function(obj, status) { .catch(({obj, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
if (status === 403) { if (status === 403) {
@@ -81,7 +81,7 @@
Wait('stop'); Wait('stop');
} }
}) })
.error(function (obj, status) { .catch(({obj, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
if (status === 403) { if (status === 403) {
@@ -127,7 +127,7 @@
scope.$emit('CancelNotAllowed'); scope.$emit('CancelNotAllowed');
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url +
' failed. GET returned: ' + status }); ' failed. GET returned: ' + status });
}); });

View File

@@ -13,7 +13,7 @@ export default
url: data.related.update url: data.related.update
}); });
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve inventory source: ' + ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve inventory source: ' +
url + ' GET returned: ' + status }); url + ' GET returned: ' + status });
}); });

View File

@@ -24,7 +24,7 @@ export default
.success(function(res){ .success(function(res){
return res; return res;
}) })
.error(function(res, status){ .catch(({res, status}) => {
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status}); msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
}); });

View File

@@ -149,7 +149,7 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
scope.$emit('AuthorizationGetLicense'); scope.$emit('AuthorizationGetLicense');
}); });
}) })
.error(function (data, status) { .catch(({data, status}) => {
Authorization.logout().then( () => { Authorization.logout().then( () => {
Wait('stop'); Wait('stop');
Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain); Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain);

View File

@@ -24,7 +24,7 @@ export default
$scope.mgmtCards = data.results; $scope.mgmtCards = data.results;
Wait('stop'); Wait('stop');
}) })
.error(function(data, status){ .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {hdr: i18n._('Error!'), ProcessErrors($scope, data, status, null, {hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Call to %s failed. Return status: %d'), (defaultUrl === undefined) ? "undefined" : defaultUrl, status )}); msg: i18n.sprintf(i18n._('Call to %s failed. Return status: %d'), (defaultUrl === undefined) ? "undefined" : defaultUrl, status )});
}); });
@@ -134,7 +134,7 @@ export default
$("#configure-dialog").dialog('close'); $("#configure-dialog").dialog('close');
$state.go('managementJobStdout', {id: data.system_job}, {reload:true}); $state.go('managementJobStdout', {id: data.system_job}, {reload:true});
}) })
.error(function(data, status) { .catch(({data, status}) => {
let template_id = scope.job_template_id; let template_id = scope.job_template_id;
template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id); template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id);
ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'),
@@ -224,7 +224,7 @@ export default
// $("#configure-dialog").dialog('close'); // $("#configure-dialog").dialog('close');
$state.go('managementJobStdout', {id: data.system_job}, {reload:true}); $state.go('managementJobStdout', {id: data.system_job}, {reload:true});
}) })
.error(function(data, status) { .catch(({data, status}) => {
let template_id = scope.job_template_id; let template_id = scope.job_template_id;
template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id); template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id);
ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'),

View File

@@ -51,7 +51,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
.then(({data}) => { .then(({data}) => {
$scope.organization_name = data.name; $scope.organization_name = data.name;
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: `Failed to retrieve organization. GET status: ${status}` msg: `Failed to retrieve organization. GET status: ${status}`
@@ -217,7 +217,7 @@ export default ['Rest', 'Wait', 'NotificationsFormObject',
$state.go('notifications', {}, { reload: true }); $state.go('notifications', {}, { reload: true });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new notifier. POST returned status: ' + status msg: 'Failed to add new notifier. POST returned status: ' + status

View File

@@ -144,7 +144,7 @@ export default ['Rest', 'Wait',
}); });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to retrieve notification: ' + id + '. GET status: ' + status msg: 'Failed to retrieve notification: ' + id + '. GET status: ' + status
@@ -284,7 +284,7 @@ export default ['Rest', 'Wait',
$state.go('notifications', {}, { reload: true }); $state.go('notifications', {}, { reload: true });
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to add new notification template. POST returned status: ' + status msg: 'Failed to add new notification template. POST returned status: ' + status

View File

@@ -180,7 +180,7 @@
} }
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -86,7 +86,7 @@ export default ['Wait', 'GetBasePath', 'ProcessErrors', 'Rest', 'GetChoices',
Wait('stop'); Wait('stop');
} }
}) })
.error( function(data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to update notification ' + data.id + ' PUT returned: ' + status }); msg: 'Failed to update notification ' + data.id + ' PUT returned: ' + status });
}); });

View File

@@ -47,7 +47,7 @@ export default ['Wait', 'ProcessErrors', 'Rest',
// Hide the working spinner // Hide the working spinner
Wait('stop'); Wait('stop');
}) })
.error( function(data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to update notification ' + data.id + ' PUT returned: ' + status }); msg: 'Failed to update notification ' + data.id + ' PUT returned: ' + status });
}); });

View File

@@ -127,7 +127,7 @@ export default ['$scope', '$location', '$stateParams',
.then(() => { .then(() => {
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
}) })
.error(function(data, status) { .catch(({data, status}) => {
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',

View File

@@ -54,7 +54,7 @@ export default ['$stateParams', '$scope', 'Rest', '$state',
}).then(() => { }).then(() => {
$state.go('.', null, { reload: true }); $state.go('.', null, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -197,7 +197,7 @@ export default ['$scope', '$rootScope', '$location',
.then(({data}) => { .then(({data}) => {
$scope.$emit('GroupSummaryReady', event, inventory, data); $scope.$emit('GroupSummaryReady', event, inventory, data);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + inventory.related.inventory_sources + ' failed. GET returned status: ' + status msg: 'Call to ' + inventory.related.inventory_sources + ' failed. GET returned status: ' + status
@@ -221,7 +221,7 @@ export default ['$scope', '$rootScope', '$location',
.then(({data}) => { .then(({data}) => {
$scope.$emit('HostSummaryReady', event, data); $scope.$emit('HostSummaryReady', event, data);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. GET returned: ' + status msg: 'Call to ' + url + ' failed. GET returned: ' + status

View File

@@ -93,7 +93,7 @@ export default ['$scope', '$rootScope',
} }
}); });
}) })
.error(function(res, status){ .catch(({res, status}) => {
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
msg: 'Call failed. Return status: '+ status}); msg: 'Call failed. Return status: '+ status});
}); });

View File

@@ -208,7 +208,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
.then(({data}) => { .then(({data}) => {
$scope.$emit('GoTojobResults', data); $scope.$emit('GoTojobResults', data);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Project lookup failed. GET returned: ' + status msg: 'Project lookup failed. GET returned: ' + status
@@ -228,7 +228,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
Alert('SCM Update Cancel', 'Your request to cancel the update was submitted to the task manager.', 'alert-info'); Alert('SCM Update Cancel', 'Your request to cancel the update was submitted to the task manager.', 'alert-info');
$scope.refresh(); $scope.refresh();
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST status: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + ' failed. POST status: ' + status });
}); });
}); });
@@ -249,7 +249,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
'Click the <em>Refresh</em> button to view the latest status.</div>', 'alert-info', null, null, null, null, true); 'Click the <em>Refresh</em> button to view the latest status.</div>', 'alert-info', null, null, null, null, true);
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + ' failed. GET status: ' + status }); ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Call to ' + url + ' failed. GET status: ' + status });
}); });
}); });
@@ -264,7 +264,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
.then(({data}) => { .then(({data}) => {
$scope.$emit('Check_Cancel', data); $scope.$emit('Check_Cancel', data);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + data.related.current_update + ' failed. GET status: ' + status msg: 'Call to ' + data.related.current_update + ' failed. GET status: ' + status
@@ -275,7 +275,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
'button to view the latest status.</div>', 'alert-info', undefined, undefined, undefined, undefined, true); 'button to view the latest status.</div>', 'alert-info', undefined, undefined, undefined, undefined, true);
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to get project failed. GET status: ' + status msg: 'Call to get project failed. GET status: ' + status

View File

@@ -53,7 +53,7 @@ export default ['$stateParams', '$scope', 'OrgUserList','Rest', '$state',
}).then(() => { }).then(() => {
$state.go('.', null, { reload: true }); $state.go('.', null, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -93,7 +93,7 @@ export default ['$stateParams', '$scope', '$rootScope',
Rest.setUrl($scope.current_url); Rest.setUrl($scope.current_url);
Rest.get() Rest.get()
.success((data) => $scope.organizations = data.results) .success((data) => $scope.organizations = data.results)
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + defaultUrl + ' failed. DELETE returned status: ' + status msg: 'Call to ' + defaultUrl + ' failed. DELETE returned status: ' + status
@@ -159,7 +159,7 @@ export default ['$stateParams', '$scope', '$rootScope',
$state.go('.', reloadListStateParams, { reload: true }); $state.go('.', reloadListStateParams, { reload: true });
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@@ -103,7 +103,7 @@ export default ['$scope', '$location', '$stateParams', 'GenerateForm',
$scope.addedItem = data.id; $scope.addedItem = data.id;
$state.go('projects.edit', { project_id: data.id }, { reload: true }); $state.go('projects.edit', { project_id: data.id }, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'),
msg: i18n._('Failed to create new project. POST returned status: ') + status }); msg: i18n._('Failed to create new project. POST returned status: ') + status });

View File

@@ -152,7 +152,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
$scope.$emit('projectLoaded'); $scope.$emit('projectLoaded');
Wait('stop'); Wait('stop');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Failed to retrieve project: %s. GET status: '), id) + status msg: i18n.sprintf(i18n._('Failed to retrieve project: %s. GET status: '), id) + status
}); });
@@ -218,7 +218,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
Wait('stop'); Wait('stop');
$state.go($state.current, {}, { reload: true }); $state.go($state.current, {}, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Failed to update project: %s. PUT status: '), id) + status }); ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Failed to update project: %s. PUT status: '), id) + status });
}); });
}; };
@@ -233,7 +233,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
.then(() => { .then(() => {
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
}) })
.error(function(data, status) { .catch(({data, status}) => {
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. POST returned status: '), url) + status }); ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. POST returned status: '), url) + status });
}); });

View File

@@ -63,7 +63,7 @@ export default
} }
scope.$emit('pathsReady'); scope.$emit('pathsReady');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to access API config. GET status: ' + status }); msg: 'Failed to access API config. GET status: ' + status });
}); });

View File

@@ -165,7 +165,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
.then(({data}) => { .then(({data}) => {
$scope.$emit('GoTojobResults', data); $scope.$emit('GoTojobResults', data);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
msg: i18n._('Project lookup failed. GET returned: ') + status }); msg: i18n._('Project lookup failed. GET returned: ') + status });
}); });
@@ -194,7 +194,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
$state.go('.', reloadListStateParams, {reload: true}); $state.go('.', reloadListStateParams, {reload: true});
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Call to %s failed. DELETE returned status: '), url) + status }); msg: i18n.sprintf(i18n._('Call to %s failed. DELETE returned status: '), url) + status });
}) })
@@ -221,7 +221,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
.then(() => { .then(() => {
Alert(i18n._('SCM Update Cancel'), i18n._('Your request to cancel the update was submitted to the task manager.'), 'alert-info'); Alert(i18n._('SCM Update Cancel'), i18n._('Your request to cancel the update was submitted to the task manager.'), 'alert-info');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. POST status: '), url) + status }); ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. POST status: '), url) + status });
}); });
}); });
@@ -242,7 +242,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
'Click the %sRefresh%s button to view the latest status.'), '<em>', '</em>') + '</div>', 'alert-info', null, null, null, null, true); 'Click the %sRefresh%s button to view the latest status.'), '<em>', '</em>') + '</div>', 'alert-info', null, null, null, null, true);
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. GET status: '), url) + status }); ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), msg: i18n.sprintf(i18n._('Call to %s failed. GET status: '), url) + status });
}); });
}); });
@@ -258,7 +258,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
.then(({data}) => { .then(({data}) => {
$scope.$emit('Check_Cancel', data); $scope.$emit('Check_Cancel', data);
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Call to %s failed. GET status: '), data.related.current_update) + status }); msg: i18n.sprintf(i18n._('Call to %s failed. GET status: '), data.related.current_update) + status });
}); });
@@ -267,7 +267,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
'button to view the latest status.'), $filter('sanitize')(name), '<em>', '</em>') + '</div>', 'alert-info',undefined,undefined,undefined,undefined,true); 'button to view the latest status.'), $filter('sanitize')(name), '<em>', '</em>') + '</div>', 'alert-info',undefined,undefined,undefined,undefined,true);
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'), ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
msg: i18n._('Call to get project failed. GET status: ') + status }); msg: i18n._('Call to get project failed. GET status: ') + status });
}); });

View File

@@ -40,7 +40,7 @@ export default
$state.go('.', reloadListStateParams, {reload: true}); $state.go('.', reloadListStateParams, {reload: true});
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
try { try {
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
} }

View File

@@ -141,7 +141,7 @@ export default
scope.$emit('ScheduleFound'); scope.$emit('ScheduleFound');
}) })
.error(function(data,status){ .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve schedule ' + id + ' GET returned: ' + status }); msg: 'Failed to retrieve schedule ' + id + ' GET returned: ' + status });
}); });

View File

@@ -43,7 +43,7 @@ export default
Wait('stop'); Wait('stop');
} }
}) })
.error(function(data, status){ .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'POST to ' + url + ' returned: ' + status }); msg: 'POST to ' + url + ' returned: ' + status });
}); });
@@ -58,7 +58,7 @@ export default
Wait('stop'); Wait('stop');
} }
}) })
.error(function(data, status){ .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'POST to ' + url + ' returned: ' + status }); msg: 'POST to ' + url + ' returned: ' + status });
}); });

View File

@@ -16,7 +16,7 @@ export default
Wait('stop'); Wait('stop');
$state.go('.', null, {reload: true}); $state.go('.', null, {reload: true});
}) })
.error( function(data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to update schedule ' + id + ' PUT returned: ' + status }); msg: 'Failed to update schedule ' + id + ' PUT returned: ' + status });
}); });
@@ -30,7 +30,7 @@ export default
.then(({data}) => { .then(({data}) => {
scope.$emit('ScheduleFound', data); scope.$emit('ScheduleFound', data);
}) })
.error(function(data,status){ .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve schedule ' + id + ' GET returned: ' + status }); msg: 'Failed to retrieve schedule ' + id + ' GET returned: ' + status });
}); });

View File

@@ -753,7 +753,7 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
.then(({data}) => { .then(({data}) => {
withOptions(data); withOptions(data);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { ProcessErrors(scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to get ' + url + '. OPTIONS status: ' + status msg: 'Failed to get ' + url + '. OPTIONS status: ' + status

View File

@@ -37,7 +37,7 @@ angular.module('ApiLoader', ['Utilities'])
$rootScope.defaultUrls = data; $rootScope.defaultUrls = data;
Store('api', data); Store('api', data);
}) })
.error(function (data, status) { .catch(({data, status}) => {
$rootScope.defaultUrls = { $rootScope.defaultUrls = {
status: 'error' status: 'error'
}; };
@@ -47,7 +47,7 @@ angular.module('ApiLoader', ['Utilities'])
}); });
}); });
}) })
.error(function (data, status) { .catch(({data, status}) => {
$rootScope.defaultUrls = { $rootScope.defaultUrls = {
status: 'error' status: 'error'
}; };

View File

@@ -41,7 +41,7 @@ export default
configInit(); configInit();
}).error(function(error) { }).catch(({error}) => {
$log.debug(error); $log.debug(error);
configInit(); configInit();
}); });

View File

@@ -117,7 +117,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
api_complete = true; api_complete = true;
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status }); msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
}); });
@@ -152,7 +152,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
} }
$('#stdoutMoreRowsBottom').fadeOut(400); $('#stdoutMoreRowsBottom').fadeOut(400);
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status }); msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
}); });
@@ -170,7 +170,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
$('#pre-container-content').append(data.content); $('#pre-container-content').append(data.content);
current_range = data.range; current_range = data.range;
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status }); msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
}); });

View File

@@ -25,7 +25,7 @@
scope.$emit(callback, data); scope.$emit(callback, data);
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
if (status === 403 && params.ignore_403) { if (status === 403 && params.ignore_403) {
return; return;
} }

View File

@@ -211,7 +211,7 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams,
} }
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve job: ' + job_id + '. GET returned: ' + status }); msg: 'Failed to retrieve job: ' + job_id + '. GET returned: ' + status });
}); });

View File

@@ -49,7 +49,7 @@ export default ['$scope', '$rootScope', 'TeamForm', 'GenerateForm', 'Rest',
$rootScope.$broadcast("EditIndicatorChange", "users", data.id); $rootScope.$broadcast("EditIndicatorChange", "users", data.id);
$state.go('teams.edit', { team_id: data.id }, { reload: true }); $state.go('teams.edit', { team_id: data.id }, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
ProcessErrors($scope, data, status, form, { ProcessErrors($scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',

View File

@@ -77,7 +77,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'TeamForm', 'Rest',
Rest.put(data).then(() => { Rest.put(data).then(() => {
$state.go($state.current, null, { reload: true }); $state.go($state.current, null, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to retrieve user: ' + msg: 'Failed to retrieve user: ' +

View File

@@ -65,7 +65,7 @@ export default ['$scope', 'Rest', 'TeamList', 'Prompt',
$state.go('.', reloadListStateParams, { reload: true }); $state.go('.', reloadListStateParams, { reload: true });
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {

View File

@@ -15,7 +15,7 @@
.success(function(res){ .success(function(res){
return res; return res;
}) })
.error(function(res, status){ .catch(({res, status}) => {
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status}); msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
}); });
@@ -46,7 +46,7 @@
return job_template_res; return job_template_res;
} }
}) })
.error(function(res, status){ .catch(({res, status}) => {
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status}); msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
}); });

View File

@@ -155,7 +155,7 @@
sync_playbook_select2(); sync_playbook_select2();
Wait('stop'); Wait('stop');
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to get playbook list for ' + url + '. GET returned status: ' + status }); msg: 'Failed to get playbook list for ' + url + '. GET returned status: ' + status });
}); });
@@ -190,7 +190,7 @@
Alert('Warning', msg, 'alert-info alert-info--noTextTransform', null, null, null, null, true); Alert('Warning', msg, 'alert-info alert-info--noTextTransform', null, null, null, null, true);
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to get project ' + $scope.project + '. GET returned status: ' + status }); msg: 'Failed to get project ' + $scope.project + '. GET returned status: ' + status });
}); });

View File

@@ -130,7 +130,7 @@ export default
Alert('Warning', msg, 'alert-info alert-info--noTextTransform', null, null, null, null, true); Alert('Warning', msg, 'alert-info alert-info--noTextTransform', null, null, null, null, true);
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
if (status === 403) { if (status === 403) {
/* User doesn't have read access to the project, no problem. */ /* User doesn't have read access to the project, no problem. */
} else { } else {
@@ -725,7 +725,7 @@ export default
.then(({data}) => { .then(({data}) => {
$scope.$emit('templateSaveSuccess', data); $scope.$emit('templateSaveSuccess', data);
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to update job template. PUT returned status: ' + status }); msg: 'Failed to update job template. PUT returned status: ' + status });
}); });

View File

@@ -75,7 +75,7 @@ export default
Wait('stop'); Wait('stop');
$state.go('.', null, {reload: true}); $state.go('.', null, {reload: true});
}) })
.error(function (data, status) { .catch(({data, status}) => {
Wait('stop'); Wait('stop');
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Could not disassociate label from JT. Call to ' + url + ' failed. DELETE returned status: ' + status }); msg: 'Could not disassociate label from JT. Call to ' + url + ' failed. DELETE returned status: ' + status });

View File

@@ -211,7 +211,7 @@ export default ['$scope', '$rootScope',
} }
}); });
}) })
.error(function(res, status){ .catch(({res, status}) => {
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
msg: 'Call failed. Return status: '+ status}); msg: 'Call failed. Return status: '+ status});
}); });

View File

@@ -45,7 +45,7 @@ export default
scope.$emit("SurveyDeleted"); scope.$emit("SurveyDeleted");
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, { hdr: 'Error!', ProcessErrors(scope, data, status, { hdr: 'Error!',
msg: 'Failed to delete survey. DELETE returned status: ' + status }); msg: 'Failed to delete survey. DELETE returned status: ' + status });
}); });

View File

@@ -45,7 +45,7 @@ export default
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve survey. GET returned status: ' + status }); msg: 'Failed to retrieve survey. GET returned status: ' + status });
}); });

View File

@@ -84,7 +84,7 @@ export default
.then(() => { .then(() => {
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to add new survey. POST returned status: ' + status }); msg: 'Failed to add new survey. POST returned status: ' + status });
}); });
@@ -101,7 +101,7 @@ export default
.then(() => { .then(() => {
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, form, { ProcessErrors(scope, data, status, form, {
hdr: 'Error!', hdr: 'Error!',
msg: 'Failed to save survey_enabled: GET status: ' + status msg: 'Failed to save survey_enabled: GET status: ' + status

View File

@@ -261,7 +261,7 @@ export default ['Rest', 'GetBasePath', '$q', 'NextPage', function(Rest, GetBaseP
Rest.options() Rest.options()
.then(({data}) => { .then(({data}) => {
deferred.resolve(data); deferred.resolve(data);
}).error(function(msg, code) { }).catch(({msg, code}) => {
deferred.reject(msg, code); deferred.reject(msg, code);
}); });
@@ -276,7 +276,7 @@ export default ['Rest', 'GetBasePath', '$q', 'NextPage', function(Rest, GetBaseP
Rest.options() Rest.options()
.then(({data}) => { .then(({data}) => {
deferred.resolve(data); deferred.resolve(data);
}).error(function(msg, code) { }).catch(({msg, code}) => {
deferred.reject(msg, code); deferred.reject(msg, code);
}); });

View File

@@ -894,7 +894,7 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
goToJobResults(res.results[0].type); goToJobResults(res.results[0].type);
} }
}) })
.error(function (data, status) { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Unable to get job: ' + status }); ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Unable to get job: ' + status });
}); });
} }

View File

@@ -95,7 +95,7 @@ export default ['$scope', '$rootScope', 'UserForm', 'GenerateForm', 'Rest',
ReturnToCaller(1); ReturnToCaller(1);
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), msg: i18n._('Failed to add new user. POST returned status: ') + status }); ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'), msg: i18n._('Failed to add new user. POST returned status: ') + status });
}); });
} else { } else {

View File

@@ -75,7 +75,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'UserForm', 'Rest',
setScopeFields(data); setScopeFields(data);
Wait('stop'); Wait('stop');
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: i18n._('Error!'), hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status
@@ -175,7 +175,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'UserForm', 'Rest',
Rest.put(data).then(() => { Rest.put(data).then(() => {
$state.go($state.current, null, { reload: true }); $state.go($state.current, null, { reload: true });
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: i18n._('Error!'), hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status msg: i18n.sprintf(i18n._('Failed to retrieve user: %s. GET status: '), $stateParams.id) + status

View File

@@ -77,7 +77,7 @@ export default ['$scope', '$rootScope', 'Rest', 'UserList', 'Prompt',
$state.go('.', null, { reload: true }); $state.go('.', null, { reload: true });
} }
}) })
.error(function(data, status) { .catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
hdr: i18n._('Error!'), hdr: i18n._('Error!'),
msg: i18n.sprintf(i18n._('Call to %s failed. DELETE returned status: '), url) + status msg: i18n.sprintf(i18n._('Call to %s failed. DELETE returned status: '), url) + status

View File

@@ -77,7 +77,7 @@ export default {
defer.resolve(data.results); defer.resolve(data.results);
} }
}) })
.error(function() { .catch(() => {
// TODO: handle this // TODO: handle this
//defer.resolve(data); //defer.resolve(data);
}); });

View File

@@ -50,7 +50,7 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
$state.go('jobs'); $state.go('jobs');
}) })
.error(function(obj, status) { .catch(({obj, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors(null, obj, status, null, { ProcessErrors(null, obj, status, null, {
@@ -71,7 +71,7 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
}) })
.error(function(obj, status) { .catch(({obj, status}) => {
Wait('stop'); Wait('stop');
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
ProcessErrors(null, obj, status, null, { ProcessErrors(null, obj, status, null, {