{"name":"@octokit/request-error","version":"6.0.0-beta.1","publishConfig":{"access":"public"},"type":"module","description":"Error class for Octokit request errors","repository":{"type":"git","url":"git+https://github.com/octokit/request-error.js.git"},"keywords":["octokit","github","api","error"],"author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"license":"MIT","dependencies":{"@octokit/types":"^12.0.0","deprecation":"^2.0.0","once":"^1.4.0"},"devDependencies":{"@octokit/tsconfig":"^3.0.0","@types/jest":"^29.0.0","@types/node":"^20.0.0","@types/once":"^1.4.0","esbuild":"^0.20.0","glob":"^10.2.6","jest":"^29.0.0","prettier":"3.2.5","ts-jest":"^29.0.0","typescript":"^5.0.0"},"engines":{"node":">= 18"},"exports":{".":{"node":{"types":"./dist-types/index.d.ts","import":"./dist-node/index.js"},"browser":{"types":"./dist-types/index.d.ts","import":"./dist-web/index.js"}}},"sideEffects":false,"unpkg":"dist-web/index.js","_id":"@octokit/request-error@6.0.0-beta.1","readme":"# http-error.js\n\n> Error class for Octokit request errors\n\n[![@latest](https://img.shields.io/npm/v/@octokit/request-error.svg)](https://www.npmjs.com/package/@octokit/request-error)\n[![Build Status](https://github.com/octokit/request-error.js/workflows/Test/badge.svg)](https://github.com/octokit/request-error.js/actions?query=workflow%3ATest)\n\n## Usage\n\n<table>\n<tbody valign=top align=left>\n<tr><th>\nBrowsers\n</th><td width=100%>\nLoad <code>@octokit/request-error</code> directly from <a href=\"https://esm.sh\">esm.sh</a>\n        \n```html\n<script type=\"module\">\nimport { RequestError } from \"https://esm.sh/@octokit/request-error\";\n</script>\n```\n\n</td></tr>\n<tr><th>\nNode\n</th><td>\n\nInstall with <code>npm install @octokit/request-error</code>\n\n```js\nconst { RequestError } = require(\"@octokit/request-error\");\n// or: import { RequestError } from \"@octokit/request-error\";\n```\n\n</td></tr>\n</tbody>\n</table>\n\n```js\nconst error = new RequestError(\"Oops\", 500, {\n  request: {\n    method: \"POST\",\n    url: \"https://api.github.com/foo\",\n    body: {\n      bar: \"baz\",\n    },\n    headers: {\n      authorization: \"token secret123\",\n    },\n  },\n  response: {\n    status: 500,\n    url: \"https://api.github.com/foo\",\n    headers: {\n      \"x-github-request-id\": \"1:2:3:4\",\n    },\n    data: {\n      foo: \"bar\",\n    },\n  },\n});\n\nerror.message; // Oops\nerror.status; // 500\nerror.request; // { method, url, headers, body }\nerror.response; // { url, status, headers, data }\n```\n\n### Usage with Octokit\n\n```js\ntry {\n  // your code here that sends at least one Octokit request\n  await octokit.request(\"GET /\");\n} catch (error) {\n  // Octokit errors always have a `error.status` property which is the http response code\n  if (error.status) {\n    // handle Octokit error\n  } else {\n    // handle all other errors\n    throw error;\n  }\n}\n```\n\n## LICENSE\n\n[MIT](LICENSE)\n","readmeFilename":"README.md","gitHead":"75a350de10571eb804f0f6c2c6d7157dafcdb95c","bugs":{"url":"https://github.com/octokit/request-error.js/issues"},"homepage":"https://github.com/octokit/request-error.js#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-aqUDRsj3ozEd8t0avh9UX/jHaO9aGeIPG22TLTw9kcPtsXtsWeouhb4vdp9ZzD9qXy9sxkwSfPjNm4PzY//Msg==","shasum":"38ec446a92cc8cbba046509a56cb5b0997d12a9e","tarball":"http://registry-npm.ywwl.com/@octokit/request-error/download/@octokit/request-error-6.0.0-beta.1.tgz","fileCount":10,"unpackedSize":12062,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwEGE7Koe5RROh56d9AcpfIvg7y6t0i0pBFDa6fyTs4wIhAIlPUVO4u8REpWwBo3KfYVBTdP48qE+ZHIQzQf7GylZh"}],"size":3389,"noattachment":false,"key":"/@octokit/request-error/-/@octokit/request-error-6.0.0-beta.1.tgz"},"_npmUser":{"name":"octokitbot","email":"security+octokitbot@github.com"},"directories":{},"maintainers":[{"name":"kfcampbell","email":"kfcampbell@github.com"},{"name":"nickfloyd","email":"nicholas.floyd.info@gmail.com"},{"name":"gr2m","email":"gregor@martynus.net"},{"name":"octokitbot","email":"security+octokitbot@github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request-error_6.0.0-beta.1_1708208810188_0.762552124977893"},"_hasShrinkwrap":false,"publish_time":1708208810342,"_cnpm_publish_time":1708208810342,"dist-tags":{"beta":"6.0.0-beta.5","latest":"7.1.2","next":"2.1.0","release-5.x":"5.1.1"}}