File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 1
- 'use strict'
2
-
3
- const STATUS_CODES = {
4
- 304 : 'Not Modified' , // See PR #673 (https://github.com/octokit/rest.js/pull/673)
5
- 400 : 'Bad Request' ,
6
- 404 : 'Not Found' ,
7
- 500 : 'Internal Server Error' ,
8
- 504 : 'Gateway Timeout'
9
- }
10
-
11
1
module . exports = class HttpError extends Error {
12
2
constructor ( message , code , headers ) {
13
3
super ( message )
14
- // Maintains proper stack trace for where our error was thrown (only available on V8)
15
- /* istanbul ignore else */
4
+
5
+ // Maintains proper stack trace
16
6
if ( Error . captureStackTrace ) {
17
7
Error . captureStackTrace ( this , this . constructor )
18
8
}
19
9
this . name = 'HttpError'
20
10
this . code = code
21
- this . status = STATUS_CODES [ code ]
22
11
this . headers = headers
23
12
}
24
13
}
You can’t perform that action at this time.
0 commit comments