diff --git a/lib/http-error.js b/lib/http-error.js index d0a87bd5a..7552f96d1 100644 --- a/lib/http-error.js +++ b/lib/http-error.js @@ -1,24 +1,14 @@ -'use strict' - -const STATUS_CODES = { - 304: 'Not Modified', // See PR #673 (https://github.com/octokit/rest.js/pull/673) - 400: 'Bad Request', - 404: 'Not Found', - 500: 'Internal Server Error', - 504: 'Gateway Timeout' -} - module.exports = class HttpError extends Error { - constructor (message, code, headers) { + constructor (message, code) { super(message) - // Maintains proper stack trace for where our error was thrown (only available on V8) - /* istanbul ignore else */ + + // Maintains proper stack trace (only available on V8) + /* istanbul ignore next */ if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor) } + this.name = 'HttpError' this.code = code - this.status = STATUS_CODES[code] - this.headers = headers } }