1 |
|
2 |
|
3 |
|
4 |
|
5 | var util = require('util')
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | function UnauthorizedError (options, status) {
|
12 | this.name = 'UnauthorizedError'
|
13 | this.error = options.error
|
14 | this.error_description = options.error_description
|
15 | this.message = options.error_description
|
16 |
|
17 |
|
18 | this.statusCode = options.statusCode || 401
|
19 | }
|
20 |
|
21 | util.inherits(UnauthorizedError, Error)
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | UnauthorizedError.errorCodes = [
|
28 | 'invalid_request',
|
29 | 'invalid_token',
|
30 | 'insufficient_scope'
|
31 | ]
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | module.exports = UnauthorizedError
|