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-
111module . exports = class HttpError extends Error {
122 constructor ( message , code , headers ) {
133 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
166 if ( Error . captureStackTrace ) {
177 Error . captureStackTrace ( this , this . constructor )
188 }
199 this . name = 'HttpError'
2010 this . code = code
21- this . status = STATUS_CODES [ code ]
2211 this . headers = headers
2312 }
2413}
You can’t perform that action at this time.
0 commit comments