{"name":"@octokit/request-error","description":"Error class for Octokit request errors","version":"2.0.2","license":"MIT","pika":true,"sideEffects":false,"keywords":["octokit","github","api","error"],"homepage":"https://github.com/octokit/request-error.js#readme","bugs":{"url":"https://github.com/octokit/request-error.js/issues"},"repository":{"type":"git","url":"git+https://github.com/octokit/request-error.js.git"},"dependencies":{"@octokit/types":"^5.0.1","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":"^26.0.0","@types/node":"^14.0.4","@types/once":"^1.4.0","jest":"^25.1.0","pika-plugin-unpkg-field":"^1.1.0","prettier":"^2.0.1","semantic-release":"^17.0.0","ts-jest":"^25.1.0","typescript":"^3.4.5"},"publishConfig":{"access":"public"},"source":"dist-src/index.js","types":"dist-types/index.d.ts","main":"dist-node/index.js","module":"dist-web/index.js","_id":"@octokit/request-error@2.0.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-2BrmnvVSV1MXQvEkrb9zwzP0wXFNbPJij922kYBTLIlIafukrGOb+ABBT2+c6wZiuyWDH1K1zmjGQ0toN/wMWw==","shasum":"0e76b83f5d8fdda1db99027ea5f617c2e6ba9ed0","tarball":"http://registry-npm.ywwl.com/@octokit/request-error/download/@octokit/request-error-2.0.2.tgz","fileCount":11,"unpackedSize":17597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe5534CRA9TVsSAnZWagAAh0wP/3y80QSEAqITrVtB+O/k\nwL8dBoZWScUd4nbQUh+/ZMFrcEpBabiIDgRchukXxDXYwGy31y3mKdIVgx4f\nnJnBPC34h+GL/y2ij+PJxN6D6nCnCFC1jz7NXk3vhZxB8Pt5lU0KtRL6T2KL\nS3nXn18mWxa14CLv2BaujLYhxpdRBU2d1dE8rB3P/csdjBpIfz75E/XlVR+G\n5iJ7fn2r9Ykq6LywZ4Y8hflpnITczRzjUGzbavOCAtuiQ+uKPD1uOwaoV26m\nnKYZGiuxUyl442DruSF0OVTqI1dx9TlpavZnWe+WgZS45K7BRzV72wNRRBcG\nIZ2e6eRpAPvlXoZhbXUJLji/7QphJskQ9UoPNSjBZXIWwJ4yZ9TM7DVk0lQR\nTusvVDD6ynvEfgXaDFHDQk21SxUoqh9o6xCdHj1U+C3V4xgvWqy4tLEq+FS4\naPFWoqZWiSoXo/20goMzAC5ZsazQRAs4yfBf+44FiwU8BJtlmi2Ku6e0KqW4\nE4dd43XBUl5meDvtuA+vKOkB/SMsrsQfhcaF3mV0PbTnZMINibtR9Wk8lYem\nb+0yj9H33y2tpaOk8HJP+J3r2ejsEPRMh5y5FNCWsmyQ010RGYgnG4jv/W0C\nEyUPTihoc2tzLfblgpXOX+rCIpMoxSG+GoQR0XIMXJDzOQ/6WXM9PA0SPUa3\nopR2\r\n=oOaX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBPO9hHpQFGsoF1Nyz44uSj+aKtqsnlpYC7+fQmC56A3AiB4yS9BsBxvBkjKBSrNoVP9LjliH5Pj6FadQhdRXy3kBQ=="}],"size":4692,"noattachment":false,"key":"/@octokit/request-error/-/@octokit/request-error-2.0.2.tgz"},"maintainers":[{"name":"bkeepers","email":"brandon@opensoul.org"},{"name":"gr2m","email":"gregor@martynus.net"},{"name":"octokitbot","email":"octokitbot@martynus.net"}],"_npmUser":{"name":"octokitbot","email":"octokitbot@martynus.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request-error_2.0.2_1592237560244_0.14041135895247203"},"_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":1592237560357,"_cnpm_publish_time":1592237560357,"dist-tags":{"beta":"6.0.0-beta.5","latest":"7.1.2","next":"2.1.0","release-5.x":"5.1.1"}}