mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-06 00:11:50 -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user