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
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE
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');
$state.go('.', null, {reload: true});
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
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');
$state.go('.', null, {reload: true});
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
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');
$state.go('.', null, { reload: true });
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($rootScope, data, status, null, {
hdr: 'Error!',
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);
})
.error(function(error) {
.catch(({error}) => {
deferred.reject(error);
});
@ -50,7 +50,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
.then(({data}) => {
deferred.resolve(data);
})
.error(function(error) {
.catch(({error}) => {
deferred.reject(error);
});
@ -64,7 +64,7 @@ export default ['$rootScope', 'GetBasePath', 'ProcessErrors', '$q', '$http', 'Re
.then(({data}) => {
deferred.resolve(data);
})
.error(function(error) {
.catch(({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 });
Wait('stop');
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, {
hdr: 'Error!',
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 });
Wait('stop');
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, {
hdr: 'Error!',
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 });
}
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

@ -63,7 +63,7 @@ export default
ReturnToCaller(1);
}
})
.error(function (data, status) {
.catch(({data, status}) => {
Wait('stop');
// 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
@ -87,7 +87,7 @@ export default
Wait('stop');
$state.go($state.current, {}, {reload: true});
})
.error(function (data, status) {
.catch(({data, status}) => {
Wait('stop');
ProcessErrors(scope, data, status, form, {
hdr: i18n._('Error!'),

View File

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

View File

@ -17,7 +17,7 @@ export default ['$scope', '$rootScope','Wait',
.then(({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 });
});
@ -26,7 +26,7 @@ export default ['$scope', '$rootScope','Wait',
.then(({data}) => {
$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 });
});
@ -35,7 +35,7 @@ export default ['$scope', '$rootScope','Wait',
.then(({data}) => {
$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 });
});
@ -94,7 +94,7 @@ export default ['$scope', '$rootScope','Wait',
$scope.dashboardData = 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 });
});
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;
$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 });
});
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;
$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 });
});
};

View File

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

View File

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

View File

@ -88,7 +88,7 @@ function InventoriesList($scope,
.then(() => {
Wait('stop');
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors( $scope, data, status, null, { hdr: 'Error!',
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}) => {
$scope.generateTable(data, event);
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors( $scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + $scope.inventory.related.inventory_sources + ' failed. GET returned status: ' + status
});

View File

@ -69,7 +69,7 @@ export default
Wait('stop');
$state.go('.', null, {reload: true});
})
.error(function (data, status) {
.catch(({data, status}) => {
Wait('stop');
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
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();
Wait('stop');
})
.error(function () {
.catch(() => {
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
Wait('stop');
});

View File

@ -131,7 +131,7 @@ export default ['$state', '$stateParams', '$scope', 'ParseVariableString',
sync_inventory_file_select2();
Wait('stop');
})
.error(function () {
.catch(() => {
Alert('Cannot get inventory files', 'Unable to retrieve the list of inventory files for this project.', 'alert-info');
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. ' +
// '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!',
msg: 'Call to ' + url + ' failed. POST status: ' + status
});
@ -42,13 +42,13 @@ export default
Wait('stop');
}
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + url + ' failed. GET status: ' + status
});
});
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Call to ' + inventory_source.url + ' failed. GET status: ' + status
});

View File

@ -21,7 +21,7 @@ export default
scope.cloudCredentialRequired = false;
scope.$emit('sourceTypeOptionsReady');
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
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});
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve inventory source: ' + inventory_source.url +
' GET returned status: ' + status });

View File

@ -24,7 +24,7 @@ export default
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
post: function(inventory_source){
@ -33,7 +33,7 @@ export default
Rest.setUrl(this.url);
return Rest.post(inventory_source)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
put: function(inventory_source){
@ -42,7 +42,7 @@ export default
Rest.setUrl(this.url);
return Rest.put(inventory_source)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
delete: function(id){
@ -51,7 +51,7 @@ export default
Rest.setUrl(this.url);
return Rest.destroy()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
options: function(){
@ -59,7 +59,7 @@ export default
Rest.setUrl(this.url);
return Rest.options()
.then(this.then.bind(this))
.error(this.error.bind(this));
.catch(this.catch.bind(this));
},
getCredential: function(id){
Wait('start');
@ -67,7 +67,7 @@ export default
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
getInventorySource: function(params){
@ -76,7 +76,7 @@ export default
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
putInventorySource: function(params, url){
@ -85,7 +85,7 @@ export default
Rest.setUrl(this.url);
return Rest.put(params)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
// 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);
return Rest.post(group)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
disassociateGroup: function(group, parent){
@ -104,7 +104,7 @@ export default
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
promote: function(group, inventory){
@ -113,7 +113,7 @@ export default
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
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, {
hdr: 'Error!',
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, {
hdr: 'Error!',
msg: 'Failed to update inventory. PUT returned status: ' + status

View File

@ -24,7 +24,7 @@ export default
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
post: function(group){
@ -33,7 +33,7 @@ export default
Rest.setUrl(this.url);
return Rest.post(group)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
put: function(group){
@ -42,7 +42,7 @@ export default
Rest.setUrl(this.url);
return Rest.put(group)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
delete: function(id){
@ -51,7 +51,7 @@ export default
Rest.setUrl(this.url);
return Rest.destroy()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
getCredential: function(id){
@ -60,7 +60,7 @@ export default
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
getInventorySource: function(params){
@ -69,7 +69,7 @@ export default
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
putInventorySource: function(params, url){
@ -78,7 +78,7 @@ export default
Rest.setUrl(this.url);
return Rest.put(params)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
// 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);
return Rest.post(group)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
disassociateGroup: function(group, parent){
@ -97,7 +97,7 @@ export default
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
associateHost: function(host, target){
@ -106,7 +106,7 @@ export default
Rest.setUrl(this.url);
return Rest.post(host)
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
disassociateHost: function(host, group){
@ -115,7 +115,7 @@ export default
Rest.setUrl(this.url);
return Rest.post({id: host, disassociate: 1})
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
promote: function(group, inventory){
@ -124,7 +124,7 @@ export default
Rest.setUrl(this.url);
return Rest.post({id: group, disassociate: 1})
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
}
};

View File

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

View File

@ -26,7 +26,7 @@
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
getBreadcrumbs: function(groups){
@ -37,7 +37,7 @@
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this))
.catch(this.catch.bind(this))
.finally(Wait('stop'));
},
rootHostsUrl: function(id){
@ -61,21 +61,21 @@
Rest.setUrl(this.url);
return Rest.options()
.then(this.then.bind(this))
.error(this.error.bind(this));
.catch(this.catch.bind(this));
},
updateInventorySourcesGet: function(inventoryId) {
this.url = GetBasePath('inventory') + inventoryId + '/update_inventory_sources';
Rest.setUrl(this.url);
return Rest.get()
.then(this.then.bind(this))
.error(this.error.bind(this));
.catch(this.catch.bind(this));
},
getHost: function(inventoryId, hostId) {
this.url = GetBasePath('inventory') + inventoryId + '/hosts?id=' + hostId;
Rest.setUrl(this.url);
return Rest.get()
.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 });
Wait('stop');
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, {
hdr: 'Error!',
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 });
Wait('stop');
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, {
hdr: 'Error!',
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 });
}
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -149,7 +149,7 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
scope.$emit('AuthorizationGetLicense');
});
})
.error(function (data, status) {
.catch(({data, status}) => {
Authorization.logout().then( () => {
Wait('stop');
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;
Wait('stop');
})
.error(function(data, status){
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {hdr: i18n._('Error!'),
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');
$state.go('managementJobStdout', {id: data.system_job}, {reload:true});
})
.error(function(data, status) {
.catch(({data, status}) => {
let template_id = scope.job_template_id;
template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id);
ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'),
@ -224,7 +224,7 @@ export default
// $("#configure-dialog").dialog('close');
$state.go('managementJobStdout', {id: data.system_job}, {reload:true});
})
.error(function(data, status) {
.catch(({data, status}) => {
let template_id = scope.job_template_id;
template_id = (template_id === undefined) ? "undefined" : i18n.sprintf("%d", template_id);
ProcessErrors(scope, data, status, null, { hdr: i18n._('Error!'),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -208,7 +208,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
.then(({data}) => {
$scope.$emit('GoTojobResults', data);
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
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');
$scope.refresh();
})
.error(function(data, status) {
.catch(({data, 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);
}
})
.error(function(data, status) {
.catch(({data, 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}) => {
$scope.$emit('Check_Cancel', data);
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
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);
}
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
msg: 'Call to get project failed. GET status: ' + status

View File

@ -53,7 +53,7 @@ export default ['$stateParams', '$scope', 'OrgUserList','Rest', '$state',
}).then(() => {
$state.go('.', null, { reload: true });
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
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.get()
.success((data) => $scope.organizations = data.results)
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
msg: 'Call to ' + defaultUrl + ' failed. DELETE returned status: ' + status
@ -159,7 +159,7 @@ export default ['$stateParams', '$scope', '$rootScope',
$state.go('.', reloadListStateParams, { reload: true });
}
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: 'Error!',
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;
$state.go('projects.edit', { project_id: data.id }, { reload: true });
})
.error(function(data, status) {
.catch(({data, status}) => {
Wait('stop');
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'),
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');
Wait('stop');
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: i18n._('Error!'),
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');
$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 });
});
};
@ -233,7 +233,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'ProjectsForm', 'Rest',
.then(() => {
$('#prompt-modal').modal('hide');
})
.error(function(data, status) {
.catch(({data, status}) => {
$('#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 });
});

View File

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

View File

@ -165,7 +165,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
.then(({data}) => {
$scope.$emit('GoTojobResults', data);
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
msg: i18n._('Project lookup failed. GET returned: ') + status });
});
@ -194,7 +194,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
$state.go('.', reloadListStateParams, {reload: true});
}
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
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(() => {
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 });
});
});
@ -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);
}
})
.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 });
});
});
@ -258,7 +258,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
.then(({data}) => {
$scope.$emit('Check_Cancel', data);
})
.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: '), 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);
}
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: i18n._('Error!'),
msg: i18n._('Call to get project failed. GET status: ') + status });
});

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -117,7 +117,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce
api_complete = true;
}
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
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);
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
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);
current_range = data.range;
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status });
});

View File

@ -25,7 +25,7 @@
scope.$emit(callback, data);
}
})
.error(function(data, status) {
.catch(({data, status}) => {
if (status === 403 && params.ignore_403) {
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!',
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);
$state.go('teams.edit', { team_id: data.id }, { reload: true });
})
.error(function(data, status) {
.catch(({data, status}) => {
Wait('stop');
ProcessErrors($scope, data, status, form, {
hdr: 'Error!',

View File

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

View File

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

View File

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

View File

@ -155,7 +155,7 @@
sync_playbook_select2();
Wait('stop');
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
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);
}
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
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);
}
})
.error(function (data, status) {
.catch(({data, status}) => {
if (status === 403) {
/* User doesn't have read access to the project, no problem. */
} else {
@ -725,7 +725,7 @@ export default
.then(({data}) => {
$scope.$emit('templateSaveSuccess', data);
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to update job template. PUT returned status: ' + status });
});

View File

@ -75,7 +75,7 @@ export default
Wait('stop');
$state.go('.', null, {reload: true});
})
.error(function (data, status) {
.catch(({data, status}) => {
Wait('stop');
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
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!',
msg: 'Call failed. Return status: '+ status});
});

View File

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

View File

@ -84,7 +84,7 @@ export default
.then(() => {
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
msg: 'Failed to add new survey. POST returned status: ' + status });
});
@ -101,7 +101,7 @@ export default
.then(() => {
})
.error(function (data, status) {
.catch(({data, status}) => {
ProcessErrors(scope, data, status, form, {
hdr: 'Error!',
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()
.then(({data}) => {
deferred.resolve(data);
}).error(function(msg, code) {
}).catch(({msg, code}) => {
deferred.reject(msg, code);
});
@ -276,7 +276,7 @@ export default ['Rest', 'GetBasePath', '$q', 'NextPage', function(Rest, GetBaseP
Rest.options()
.then(({data}) => {
deferred.resolve(data);
}).error(function(msg, code) {
}).catch(({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);
}
})
.error(function (data, status) {
.catch(({data, 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);
}
})
.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 });
});
} else {

View File

@ -75,7 +75,7 @@ export default ['$scope', '$rootScope', '$stateParams', 'UserForm', 'Rest',
setScopeFields(data);
Wait('stop');
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: i18n._('Error!'),
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(() => {
$state.go($state.current, null, { reload: true });
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: i18n._('Error!'),
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 });
}
})
.error(function(data, status) {
.catch(({data, status}) => {
ProcessErrors($scope, data, status, null, {
hdr: i18n._('Error!'),
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);
}
})
.error(function() {
.catch(() => {
// TODO: handle this
//defer.resolve(data);
});

View File

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