|
|
@ -23,7 +23,7 @@ export const handleError = function(error, useToastr = true) { |
|
|
|
} |
|
|
|
} |
|
|
|
const details = Object.entries(error.details || {}) |
|
|
|
const details = Object.entries(error.details || {}) |
|
|
|
.reduce((obj, [key, value]) => ({ ...obj, [key]: escapeHTML(value) }), {}); |
|
|
|
.reduce((obj, [key, value]) => ({ ...obj, [key]: escapeHTML(value) }), {}); |
|
|
|
const message = TAPi18n.__(error.message || error.error, details); |
|
|
|
const message = TAPi18n.__(error.error || error.message, details); |
|
|
|
const title = details.errorTitle && TAPi18n.__(details.errorTitle); |
|
|
|
const title = details.errorTitle && TAPi18n.__(details.errorTitle); |
|
|
|
|
|
|
|
|
|
|
|
return toastr.error(message, title); |
|
|
|
return toastr.error(message, title); |
|
|
|