Gathering detailed insights and metrics for @octokit/request-error
Gathering detailed insights and metrics for @octokit/request-error
Gathering detailed insights and metrics for @octokit/request-error
Gathering detailed insights and metrics for @octokit/request-error
@octokit/plugin-request-log
Log all requests and request errors
@octokit/request
Send parameterized requests to GitHub's APIs with sensible defaults in browsers and Node
@octokit/endpoint
Turns REST API endpoints into generic request options
@octokit/core
Extendable client for GitHub's REST & GraphQL APIs
npm install @octokit/request-error
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
14 Stars
528 Commits
11 Forks
9 Watching
7 Branches
17 Contributors
Updated on 26 Nov 2024
TypeScript (61.9%)
JavaScript (38.1%)
Cumulative downloads
Total Downloads
Last day
-9.7%
2,083,901
Compared to previous day
Last week
4.2%
12,757,920
Compared to previous week
Last month
7%
51,864,725
Compared to previous month
Last year
20.7%
494,961,719
Compared to previous year
1
Error class for Octokit request errors
Browsers |
Load @octokit/request-error directly from esm.sh
|
---|---|
Node |
Install with
|
[!IMPORTANT] As we use conditional exports, you will need to adapt your
tsconfig.json
by setting"moduleResolution": "node16", "module": "node16"
.See the TypeScript docs on package.json "exports".
See this helpful guide on transitioning to ESM from @sindresorhus
1const error = new RequestError("Oops", 500, { 2 request: { 3 method: "POST", 4 url: "https://api.github.com/foo", 5 body: { 6 bar: "baz", 7 }, 8 headers: { 9 authorization: "token secret123", 10 }, 11 }, 12 response: { 13 status: 500, 14 url: "https://api.github.com/foo", 15 headers: { 16 "x-github-request-id": "1:2:3:4", 17 }, 18 data: { 19 foo: "bar", 20 }, 21 }, 22}); 23 24error.message; // Oops 25error.status; // 500 26error.request; // { method, url, headers, body } 27error.response; // { url, status, headers, data }
1try { 2 // your code here that sends at least one Octokit request 3 await octokit.request("GET /"); 4} catch (error) { 5 // Octokit errors always have a `error.status` property which is the http response code 6 if (error.status) { 7 // handle Octokit error 8 } else { 9 // handle all other errors 10 throw error; 11 } 12}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
20 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
all changesets reviewed
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
SAST tool is run on all commits
Details
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 5
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More