Browse Source

Merge branch 'fix_dojo_dmt_error_handling' into 'develop'

check that jqxhr['responseJSON']['error'] is a string

See merge request dojo/samourai-dojo!176
use-env-var-docker
kenshin-samourai 4 years ago
parent
commit
e95d96e053
  1. 3
      static/admin/lib/errors-utils.js

3
static/admin/lib/errors-utils.js

@ -4,7 +4,8 @@ const lib_errors = {
extractJqxhrErrorMsg: function(jqxhr) {
let hasErrorMsg = ('responseJSON' in jqxhr) &&
(jqxhr['responseJSON'] != null) &&
('error' in jqxhr['responseJSON'])
('error' in jqxhr['responseJSON']) &&
(typeof jqxhr['responseJSON']['error'] == 'string')
return hasErrorMsg ? jqxhr['responseJSON']['error'] : jqxhr.statusText
},

Loading…
Cancel
Save