Merge pull request #4645 from chrismeyersfsu/fix-3245

gracefully handle 409 on delete
This commit is contained in:
Chris Meyers
2017-01-10 18:14:21 -05:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -198,6 +198,8 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
msg += 'Please contact your system administrator.'; msg += 'Please contact your system administrator.';
} }
Alert(defaultMsg.hdr, msg); Alert(defaultMsg.hdr, msg);
} else if (status === 409) {
Alert('Conflict', data.conflict || "Resource currently in use.");
} else if (status === 410) { } else if (status === 410) {
Alert('Deleted Object', 'The requested object was previously deleted and can no longer be accessed.'); Alert('Deleted Object', 'The requested object was previously deleted and can no longer be accessed.');
} else if ((status === 'Token is expired') || (status === 401 && data.detail && data.detail === 'Token is expired') || } else if ((status === 'Token is expired') || (status === 401 && data.detail && data.detail === 'Token is expired') ||

View File

@@ -131,7 +131,7 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest',
handleSuccessfulDelete(); handleSuccessfulDelete();
}, function (data) { }, function (data) {
Wait('stop'); Wait('stop');
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, data.status, null, { hdr: 'Error!',
msg: 'Call to delete workflow job template failed. DELETE returned status: ' + status }); msg: 'Call to delete workflow job template failed. DELETE returned status: ' + status });
}); });
} }
@@ -141,8 +141,8 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', 'Rest',
handleSuccessfulDelete(); handleSuccessfulDelete();
}, function (data) { }, function (data) {
Wait('stop'); Wait('stop');
ProcessErrors($scope, data, status, null, { hdr: 'Error!', ProcessErrors($scope, data, data.status, null, { hdr: 'Error!',
msg: 'Call to delete job template failed. DELETE returned status: ' + status }); msg: 'Call to delete job template failed. DELETE returned status: ' + data.status });
}); });
} }
else { else {