{"name":"@octokit/request-error","description":"Error class for Octokit request errors","version":"3.0.0","license":"MIT","pika":true,"sideEffects":false,"keywords":["octokit","github","api","error"],"repository":{"type":"git","url":"git+https://github.com/octokit/request-error.js.git"},"dependencies":{"@octokit/types":"^6.0.3","deprecation":"^2.0.0","once":"^1.4.0"},"devDependencies":{"@pika/pack":"^0.5.0","@pika/plugin-build-node":"^0.9.0","@pika/plugin-build-web":"^0.9.0","@pika/plugin-bundle-web":"^0.9.0","@pika/plugin-ts-standard-pkg":"^0.9.0","@types/jest":"^27.0.0","@types/node":"^16.0.0","@types/once":"^1.4.0","jest":"^27.0.0","pika-plugin-unpkg-field":"^1.1.0","prettier":"2.7.1","ts-jest":"^27.0.0-next.12","typescript":"^4.0.0"},"engines":{"node":">= 14"},"publishConfig":{"access":"public"},"source":"dist-src/index.js","types":"dist-types/index.d.ts","main":"dist-node/index.js","module":"dist-web/index.js","gitHead":"0a86afe38fdffc884b29c3e466d1f29d5cebee45","bugs":{"url":"https://github.com/octokit/request-error.js/issues"},"homepage":"https://github.com/octokit/request-error.js#readme","_id":"@octokit/request-error@3.0.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w==","shasum":"f527d178f115a3b62d76ce4804dd5bdbc0270a81","tarball":"http://registry-npm.ywwl.com/@octokit/request-error/download/@octokit/request-error-3.0.0.tgz","fileCount":11,"unpackedSize":21882,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFtHMMt8P+8GaXIYGpcNpuV5kwbjndVNm7k1FVjMay0WAiBHjQj98odNfqa6oZ8YBTwA8iH89N0UwO2lieyYmUljqw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiyGsmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoevw//RUJn0yW3B+zFiXdclajGPbd9KAdtGXcdb9Qr/8PuHw6mV0uC\r\nlk/2pOf3guGJfIwLhgO3AlG7y5l10BjbmSHxkCDN+gAKZL8mWSVudRW1N6m8\r\nizuRk+O1ZaJeW0isZu/AnuWMY1IDVjYarO1nyFTpyl8F69uFwfGEUTxONlLf\r\nbICAXfPnmpmGQs9Yp4I8Ez/TfxL4PM+xdo8irgc39m7618+hM0jphAj6/Adz\r\n9PaLqvMBf4ArTP8l400IK+GZOJTNbMyEor2ESBhtk58vaq0XQG1Zz6d26XWR\r\ngXmW9veqNXUUBkduUdDJG5WGp0hQ1qKR7hXAGLHRrE4DsFAZVqcy/PKDlJ9I\r\ncPe1fgcIn/mIqIo1Z/8QE6QHg0YztTiKDm52p+uy9GAgyrLFIMwcqS75z8kf\r\nGubQ/NnL2xtxvx7k3qNmmIMNuMnwytUVzteG/WqwLNKIx5kH+ZGMbUADw3Lf\r\nEBUs5xwJCzS/9d/UceaMl5DlAzZLP8xOdQ/V/goGt5MiB35GhCwySP/vXf10\r\npSW4BkSsi9YwiDLOylgza8mTRyhj3bcNXzYqlDfTv4mNpciXkK0CVU+BmPCY\r\nHWZ6nUuBX8KGDwC3xB1+gGhUbynrdV26v7z4SQIZ43g3XK9K/c5CXZsa7W89\r\nVpqqPkY69SmrP2sruPv7yLxodhqq9MZLA+8=\r\n=Yd82\r\n-----END PGP SIGNATURE-----\r\n","size":5190,"noattachment":false,"key":"/@octokit/request-error/-/@octokit/request-error-3.0.0.tgz"},"_npmUser":{"name":"octokitbot","email":"security+octokitbot@github.com"},"directories":{},"maintainers":[{"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_3.0.0_1657301798303_0.10990606825804017"},"_hasShrinkwrap":false,"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\nimport { RequestError } from \"@octokit/request-error\";\n```\n\n</td></tr>\n</tbody>\n</table>\n\n> [!IMPORTANT]\n> 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\"`.\n>\n> See the TypeScript docs on [package.json \"exports\"](https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports).<br>\n> See this [helpful guide on transitioning to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) from [@sindresorhus](https://github.com/sindresorhus)\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","publish_time":1657301798536,"_cnpm_publish_time":1657301798536,"dist-tags":{"beta":"6.0.0-beta.5","latest":"7.1.2","next":"2.1.0","release-5.x":"5.1.1"}}