mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-11-27 16:50:59 -05:00
1.6 KiB
1.6 KiB
http-error.js
Error class for Octokit request errors
Usage
Browsers |
Load @octokit/request-error directly from cdn.pika.dev
|
---|---|
Node |
Install with
|
const error = new RequestError("Oops", 500, {
headers: {
"x-github-request-id": "1:2:3:4"
}, // response headers
request: {
method: "POST",
url: "https://api.github.com/foo",
body: {
bar: "baz"
},
headers: {
authorization: "token secret123"
}
}
});
error.message; // Oops
error.status; // 500
error.headers; // { 'x-github-request-id': '1:2:3:4' }
error.request.method; // POST
error.request.url; // https://api.github.com/foo
error.request.body; // { bar: 'baz' }
error.request.headers; // { authorization: 'token [REDACTED]' }