mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 19:30:39 -03:30
Merge pull request #5654 from jaredevantabor/invalid-search-error
adding better error handling for smart search
This commit is contained in:
commit
911dcc4cef
@ -260,9 +260,15 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear
|
||||
}.bind(this));
|
||||
},
|
||||
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!',
|
||||
msg: "Invalid search term entered."
|
||||
msg: `Invalid search term entered. GET returned: ${status}`
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user