@octokit/request-error
Advanced tools
Comparing version 2.1.0 to 3.0.0
{ | ||
"name": "@octokit/request-error", | ||
"description": "Error class for Octokit request errors", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"license": "MIT", | ||
@@ -30,12 +30,14 @@ "files": [ | ||
"@pika/plugin-ts-standard-pkg": "^0.9.0", | ||
"@types/jest": "^26.0.0", | ||
"@types/node": "^14.0.4", | ||
"@types/jest": "^27.0.0", | ||
"@types/node": "^16.0.0", | ||
"@types/once": "^1.4.0", | ||
"jest": "^27.0.0", | ||
"pika-plugin-unpkg-field": "^1.1.0", | ||
"prettier": "2.3.1", | ||
"semantic-release": "^17.0.0", | ||
"prettier": "2.7.1", | ||
"ts-jest": "^27.0.0-next.12", | ||
"typescript": "^4.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 14" | ||
}, | ||
"publishConfig": { | ||
@@ -42,0 +44,0 @@ "access": "public" |
@@ -41,5 +41,2 @@ # http-error.js | ||
const error = new RequestError("Oops", 500, { | ||
headers: { | ||
"x-github-request-id": "1:2:3:4", | ||
}, // response headers | ||
request: { | ||
@@ -55,2 +52,12 @@ method: "POST", | ||
}, | ||
response: { | ||
status: 500, | ||
url: "https://api.github.com/foo" | ||
headers: { | ||
"x-github-request-id": "1:2:3:4", | ||
}, | ||
data: { | ||
foo: "bar" | ||
} | ||
}, | ||
}); | ||
@@ -60,6 +67,3 @@ | ||
error.status; // 500 | ||
error.request.method; // POST | ||
error.request.url; // https://api.github.com/foo | ||
error.request.body; // { bar: 'baz' } | ||
error.request.headers; // { authorization: 'token [REDACTED]' } | ||
error.request; // { method, url, headers, body } | ||
error.response; // { url, status, headers, data } | ||
@@ -66,0 +70,0 @@ ``` |
13
72
21882