{"name":"@octokit/request-error","description":"Error class for Octokit request errors","version":"1.0.1","license":"MIT","source":"dist-src/index.js","types":"dist-types/index.d.ts","main":"dist-node/index.js","module":"dist-web/index.js","unpkg":"dist-web/index.bundled.js","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":{"deprecation":"^2.0.0","once":"^1.4.0"},"devDependencies":{"@gr2m/pika-plugin-bundle-web":"^0.3.16-patch-issue-46-6","@pika/pack":"^0.3.7","@pika/plugin-build-node":"^0.3.16","@pika/plugin-build-web":"^0.3.16","@pika/plugin-ts-standard-pkg":"^0.3.16","@types/jest":"^24.0.12","@types/node":"^11.13.8","@types/once":"^1.4.0","jest":"^24.7.1","pika-plugin-unpkg-field":"^1.1.0","prettier":"^1.17.0","semantic-release":"^15.10.5","ts-jest":"^24.0.2","typescript":"^3.4.5"},"publishConfig":{"access":"public"},"_id":"@octokit/request-error@1.0.1","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-i7r3/Pv5p1ZANU+C6NmaO/fghk/qwwVe5k6+seOrI2upPEYjrlyx1u7mlJy5Ip6eZBCHMdiuldgSzs39zyh2QA==","shasum":"d3b33922f948c52fbfe96fd9b1c9e60e8f9c21b9","tarball":"http://registry-npm.ywwl.com/@octokit/request-error/download/@octokit/request-error-1.0.1.tgz","fileCount":10,"unpackedSize":14180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3c8iCRA9TVsSAnZWagAAOWMQAJLRLCaPoFNH8Qgo0ko3\nGEeKNTBiu4z2J2Z3yYlWeA96sgLJGFJ8GEkSmtWHv+ukbSoJae1N7U1//lBa\nT4Pvv0VKFRnmHAmPkz6Yfsp5ziDMUn9+bR1mLXgx+QctQEywojAzOgqplOgS\neBFr3fRbDjjycPuzYOPx0FlMOGMegO9rKpSZv7OnkqS7C1OtZersLs7dHdyo\n2VWgfEjLtziO+JLja06XsTanBqmyY7wnPBddvMrSY5tROIeYkWiXGNSfgqj+\nqHMCXr6JvHoQTOvDG9Fml4dLSvh+azlOa0fQYEFTMZ4XkoGRBGQOMxuPVGJa\n8OWJ9goe1an7TqlCPyq8NLbdZV89Ms3FEb/dvdPgOIz8JZJ20QL8AlFyXnlf\nfUnTWpxjiJfbJgxlO+w8GXxUnbFAOBwk5d8E1WfhMPZQ6oV6bhPNQGuI0b6F\nGVOBiGWZY2rYF6QVuG9rEkR01Ic5izM2fYF8uPVDC8Cadca5XP89N4d736Fd\nPUDSsXLhwr6sGILiY9Nfa+oiEcugbySyjsejOg8pHEaOvJL5Dk8M0s9TjKOs\nc2bYlip7IwqfeMhw5PqaeZeW1lbOPmu2zr3uhbsjBgnmOLvC/kgJ7PS0PshG\nA3t8J/GwI6m0lT0oOlR+GBXanDHdewOeqZ60o5Mh+zMRz5c+iDs1nBxOQ8Cr\nJcyP\r\n=mOxh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6Z/Du2At7k+vGfWaBieYKC8x748d2586vsdgztMDgggIgSpMLESlD5ifP6GtDgnTEU1oCaKG91iXqla1pxNPX/Nw="}],"size":4253,"noattachment":false,"key":"/@octokit/request-error/-/@octokit/request-error-1.0.1.tgz"},"maintainers":[{"name":"bkeepers","email":"brandon@opensoul.org"},{"name":"gr2m","email":"gregor@martynus.net"},{"name":"octokitbot","email":"octokitbot@martynus.net"}],"_npmUser":{"name":"gr2m","email":"gregor@martynus.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/request-error_1.0.1_1558040353813_0.590746794968166"},"_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":1558040353941,"_cnpm_publish_time":1558040353941,"dist-tags":{"beta":"6.0.0-beta.5","latest":"7.1.2","next":"2.1.0","release-5.x":"5.1.1"}}