mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 17:51:06 -03:30
Merge pull request #5654 from jaredevantabor/invalid-search-error
adding better error handling for smart search
This commit is contained in:
@@ -260,9 +260,15 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
error(data, status) {
|
error(data, status) {
|
||||||
ProcessErrors($rootScope, null, status, null, {
|
if(data && data.detail){
|
||||||
|
let error = JSON.parse(data.detail);
|
||||||
|
if(_.isArray(error)){
|
||||||
|
data.detail = error[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ProcessErrors($rootScope, data, status, null, {
|
||||||
hdr: 'Error!',
|
hdr: 'Error!',
|
||||||
msg: "Invalid search term entered."
|
msg: `Invalid search term entered. GET returned: ${status}`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user