1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #7204 from marshmalien/fix/handleJobQueryResponseError

Handle SyntaxError during job search query
This commit is contained in:
Marliana Lara 2017-07-21 09:53:13 -04:00 committed by GitHub
commit 80488e8333

View File

@ -254,7 +254,8 @@ export default ['$q', 'Rest', 'ProcessErrors', '$rootScope', 'Wait', 'DjangoSear
},
error(data, status) {
if(data && data.detail){
let error = JSON.parse(data.detail);
let error = typeof data.detail === "string" ? data.detail : JSON.parse(data.detail);
if(_.isArray(error)){
data.detail = error[0];
}