Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
blueslip: Convert BlueslipError to an ES6 class.
Anders Kaseorg58c84940f44e
diff --git a/static/js/blueslip.js b/static/js/blueslip.jsindex ca61fd4b1c5..b0da2052b63 100644--- a/static/js/blueslip.js+++ b/static/js/blueslip.js@@ -184,24 +184,17 @@ function report_error(msg, stack, opts) {}}-function BlueslipError(msg, more_info) {- // One can't subclass Error normally so we have to play games- // with setting __proto__- const self = new Error(msg);- self.name = "BlueslipError";+class BlueslipError extends Error {+ name = "BlueslipError";- // Indirect access to __proto__ keeps jslint quiet- const proto = "__proto__";- self[proto] = BlueslipError.prototype;-- if (more_info !== undefined) {- self.more_info = more_info;+ constructor(msg, more_info) {+ super(msg);+ if (more_info !== undefined) {+ this.more_info = more_info;+ }}- return self;}-BlueslipError.prototype = Object.create(Error.prototype);-exports.exception_msg = function blueslip_exception_msg(ex) {let message = ex.message;if (ex.fileName !== undefined) {