Closed ScotteRoberts-wm closed 2 years ago
There is an issue when running this code in Firefox. I have added an if statement to guard against Error.captureStackTrace being undefined.
Error.captureStackTrace
Code Fix:
function ProbeError(message, code, statusCode) { Error.call(this); if (Error.captureStackTrace) Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; this.message = message; if (code) this.code = code; if (statusCode) this.statusCode = statusCode; }
Resource: https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/error#custom_error_types
@puzrin I was wondering if a code change would be made for the bug? 😄
There is an issue when running this code in Firefox. I have added an if statement to guard against
Error.captureStackTrace
being undefined.Code Fix:
Resource: https://developer.mozilla.org/en-US/docs/web/javascript/reference/global_objects/error#custom_error_types