Fix dependabot errors
I explicitly had to downgrade "@octokit/plugin-retry" to "^6.0.0". Other dependencies were upgraded.
This commit is contained in:
parent
f338ec87a3
commit
5f98c40063
1536 changed files with 52911 additions and 424849 deletions
50
node_modules/@octokit/request-error/README.md
generated
vendored
50
node_modules/@octokit/request-error/README.md
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
# http-error.js
|
||||
# request-error.js
|
||||
|
||||
> Error class for Octokit request errors
|
||||
|
||||
|
|
@ -12,11 +12,11 @@
|
|||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/request-error</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.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.skypack.dev/@octokit/request-error";
|
||||
import { RequestError } from "https://esm.sh/@octokit/request-error";
|
||||
</script>
|
||||
```
|
||||
|
||||
|
|
@ -28,19 +28,21 @@ Node
|
|||
Install with <code>npm install @octokit/request-error</code>
|
||||
|
||||
```js
|
||||
const { RequestError } = require("@octokit/request-error");
|
||||
// or: import { RequestError } from "@octokit/request-error";
|
||||
import { RequestError } from "@octokit/request-error";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
> [!IMPORTANT]
|
||||
> As we use [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), you will need to adapt your `tsconfig.json` by setting `"moduleResolution": "node16", "module": "node16"`.
|
||||
>
|
||||
> See the TypeScript docs on [package.json "exports"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>
|
||||
> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)
|
||||
|
||||
```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,17 +53,41 @@ 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.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
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue