New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@crypto-connect/errors

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crypto-connect/errors

CryptoConnect custom errors

  • 0.0.2-alpha.55
  • canary
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

CryptoConnect Errors

import {
  UndocumentedResultError,
  CryptoConnectError,
  NoCredentialsError,
  NotAuthorizedError,
  ServerError,
} from "@crypto-connect/errors";

try {
  // Do something with Crypto Connect
  // ...
} catch (err) {
  if (err instanceof CryptoConnectError) {
    // All custom errors
  }

  if (err instanceof UndocumentedResultError) {
    // API response doesn't match CryptoConnect's expectations
  }

  if (err instanceof NoCredentialsError) {
    // Methods that requires authorization has been called before
    // credentials have been provided
  }

  if (err instanceof NotAuthorizedError) {
    // Credentials have been supplied but are not sufficient to authorize
    // the request
  }

  if (err instanceof ServerError) {
    // Server responded with a non-200 status
  }
}

FAQs

Package last updated on 04 Sep 2021

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