1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1x 1x 1x 1x 1x 1x 1x | export function ForbiddenError(message) { Error.call(this); this.message = message; this.constructor = ForbiddenError; Eif (typeof Error.captureStackTrace === 'function') { this.name = this.constructor.name; Error.captureStackTrace(this, this.constructor); } else { this.stack = new Error(this.message).stack; } } ForbiddenError.prototype = Object.create(Error.prototype); |