@octokit/request-error
Advanced tools
Comparing version 3.0.3 to 4.0.0
{ | ||
"name": "@octokit/request-error", | ||
"description": "Error class for Octokit request errors", | ||
"version": "3.0.3", | ||
"version": "4.0.0", | ||
"license": "MIT", | ||
@@ -39,8 +39,8 @@ "files": [ | ||
"pika-plugin-unpkg-field": "^1.1.0", | ||
"prettier": "2.8.3", | ||
"prettier": "2.8.8", | ||
"ts-jest": "^29.0.0", | ||
"typescript": "^4.0.0" | ||
"typescript": "^5.0.0" | ||
}, | ||
"engines": { | ||
"node": ">= 14" | ||
"node": ">= 18" | ||
}, | ||
@@ -47,0 +47,0 @@ "publishConfig": { |
@@ -69,4 +69,21 @@ # http-error.js | ||
### 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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89
6675
4
60