Socket
Socket
Sign inDemoInstall

fasterror

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

fasterror


Version published
Weekly downloads
1.9K
increased by67.28%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

fasterror

Quickly create custom error objects.

Build Status

var fasterror = require('fasterror');
var MyError = fasterror('MyError', {code: 'ENOENT'});

fasterror() is the factory for creating custom error objects. The first argument is the name of the desired custom error object. The second is an object containing keys that will decoate any errors created with the resulting object.

var err = new MyError('Failed to load user', {reason: 'missing', code: 2});

Create new errors with the resulting object. The first argument is the error message. The second is an object containing keys that will decorate the error, overriding any keys set by the factory.

FAQs

Last updated on 27 Jan 2014

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc