Update checked-in dependencies
This commit is contained in:
parent
4fad06f438
commit
40a500c743
4168 changed files with 298222 additions and 374905 deletions
41
node_modules/@octokit/request-error/README.md
generated
vendored
41
node_modules/@octokit/request-error/README.md
generated
vendored
|
|
@ -12,11 +12,11 @@
|
|||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/request-error</code> directly from <a href="https://cdn.pika.dev">cdn.pika.dev</a>
|
||||
Load <code>@octokit/request-error</code> directly from <a href="https://esm.sh">esm.sh</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { RequestError } from "https://cdn.pika.dev/@octokit/request-error";
|
||||
import { RequestError } from "https://esm.sh/@octokit/request-error";
|
||||
</script>
|
||||
```
|
||||
|
||||
|
|
@ -38,9 +38,6 @@ const { RequestError } = require("@octokit/request-error");
|
|||
|
||||
```js
|
||||
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",
|
||||
|
|
@ -51,15 +48,39 @@ const error = new RequestError("Oops", 500, {
|
|||
authorization: "token secret123",
|
||||
},
|
||||
},
|
||||
response: {
|
||||
status: 500,
|
||||
url: "https://api.github.com/foo",
|
||||
headers: {
|
||||
"x-github-request-id": "1:2:3:4",
|
||||
},
|
||||
data: {
|
||||
foo: "bar",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
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]' }
|
||||
error.request; // { method, url, headers, body }
|
||||
error.response; // { url, status, headers, data }
|
||||
```
|
||||
|
||||
### Usage with Octokit
|
||||
|
||||
```js
|
||||
try {
|
||||
// your code here that sends at least one Octokit request
|
||||
await octokit.request("GET /");
|
||||
} catch (error) {
|
||||
// Octokit errors always have a `error.status` property which is the http response code
|
||||
if (error.status) {
|
||||
// handle Octokit error
|
||||
} else {
|
||||
// handle all other errors
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue