Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit-next/request-error

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit-next/request-error

Error class for Octokit request errors

  • 2.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
38
increased by35.71%
Maintainers
2
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 03 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc