Skip to content

Commit d969097

Browse files
committed
fix: remove undocumented error.status
1 parent 47200d8 commit d969097

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

lib/http-error.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
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-
111
module.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
}

0 commit comments

Comments
 (0)