The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/lib/handleError.js

19 lines
600 B

import _ from 'underscore';
import s from 'underscore.string';
import toastr from 'toastr';
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.__(error.details[key]);
}
}
}
if (useToastr) {
return toastr.error(s.escapeHTML(TAPi18n.__(error.error, error.details)), error.details && error.details.errorTitle ? s.escapeHTML(TAPi18n.__(error.details.errorTitle)) : null);
}
return s.escapeHTML(TAPi18n.__(error.error, error.details));
};