jayfella c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
..
dist-node c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
dist-src c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
dist-types c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
dist-web c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
LICENSE c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
README.md c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos
package.json c97084e992 Initial Commit %!s(int64=5) %!d(string=hai) anos

README.md

http-error.js

Error class for Octokit request errors

Build Status Greenkeeper

Usage

Browsers Load @octokit/request-error directly from cdn.pika.dev ```html ```
Node Install with npm install @octokit/request-error ```js const { RequestError } = require("@octokit/request-error"); // or: import { RequestError } from "@octokit/request-error"; ```
const error = new RequestError("Oops", 500, {
  headers: {
    "x-github-request-id": "1:2:3:4"
  }, // response headers
  request: {
    method: "POST",
    url: "https://api.github.com/foo",
    body: {
      bar: "baz"
    },
    headers: {
      authorization: "token secret123"
    }
  }
});

error.message; // Oops
error.status; // 500
error.headers; // { 'x-github-request-id': '1:2:3:4' }
error.request.method; // POST
error.request.url; // https://api.github.com/foo
error.request.body; // { bar: 'baz' }
error.request.headers; // { authorization: 'token [REDACTED]' }

LICENSE

MIT