1 | const util = require('util')
|
2 |
|
3 | module.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 |
|
14 | util.inherits(module.exports, Error)
|