@octokit-next/request-error
Error class for Octokit request errors
Last updated 4 years ago by octokit-next-bot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @octokit-next/request-error 
SYNC missed versions from official npm registry.

request-error.js

Error class for Octokit request errors

@latest Build Status

Usage

Browsers Load @octokit-next/request-error directly from cdn.skypack.dev
<script type="module">
import { RequestError } from "https://cdn.skypack.dev/@octokit-next/request-error";
</script>
Node

Install with npm install @octokit-next/request-error

import { RequestError } from "@octokit-next/request-error";
const error = new RequestError("Oops", 500, {
  request: {
    method: "POST",
    url: "https://api.github.com/foo",
    body: {
      bar: "baz",
    },
    headers: {
      authorization: "token secret123",
    },
  },
  response: {
    status: 500,
    url: "https://api.github.com/foo"
    headers: {
      "x-github-request-id": "1:2:3:4",
    },
    data: {
      foo: "bar"
    }
  },
});

error.message; // Oops
error.status; // 500
error.request; // { method, url, headers, body }
error.response; // { url, status, headers, data }

LICENSE

MIT

Current Tags

  • 2.7.0                                ...           latest (3 years ago)

12 Versions

  • 2.7.0                                ...           3 years ago
  • 2.6.1                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.2                                ...           4 years ago
  • 2.5.1                                ...           4 years ago
  • 2.5.0                                ...           4 years ago
  • 2.4.1                                ...           4 years ago
  • 2.4.0                                ...           4 years ago
  • 2.3.1                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 11
Last Month 12
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |