Update handleError.js

pull/7308/head
Rodrigo Nascimento 9 years ago committed by GitHub
parent 0ca1c8ab35
commit ca07c82efe
  1. 6
      client/lib/handleError.js

@ -3,14 +3,14 @@ this.handleError = function(error, useToastr = true) {
if (_.isObject(error.details)) {
for (const key in error.details) {
if (error.details.hasOwnProperty(key)) {
error.details[key] = TAPi18n.__(_.escapeHTML(error.details[key]));
error.details[key] = TAPi18n.__(error.details[key]);
}
}
}
if (useToastr) {
return toastr.error(TAPi18n.__(error.error, error.details), error.details && error.details.errorTitle ? TAPi18n.__(error.details.errorTitle) : null);
return toastr.error(_.escapeHTML(TAPi18n.__(error.error, error.details)), error.details && error.details.errorTitle ? _.escapeHTML(TAPi18n.__(error.details.errorTitle)) : null);
}
return TAPi18n.__(error.error, error.details);
return _.escapeHTML(TAPi18n.__(error.error, error.details));
};

Loading…
Cancel
Save