UNPKG

323 BJavaScriptView Raw
1const util = require('util')
2
3module.exports = function UnauthorizedError (code, error) {
4 Error.captureStackTrace(this, this.constructor)
5
6 this.name = this.constructor.name
7 this.message = error.message
8
9 this.code = code
10 this.status = 403
11 this.inner = error
12}
13
14util.inherits(module.exports, Error)