mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-02 21:01:49 -05:00
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:
committed by
Marliana Lara
parent
834e6c692c
commit
7d767f8f63
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user