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

bugsy

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bugsy

Collection of helpers to deal with errors in Node.js

  • 0.0.2
  • Source
  • npm
  • Socket score

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

bugsy

Collection of helpers to deal with errors.

Dealing with errors is a common problem in every kind of project. While a lot of libraries simply focus on their creation, this library is meant to deal whole way through their lifecycle.

Features

  • Inheritance management
  • Error severity support
  • Matching transformations
  • Flow definition

Installation

NPM

$ npm install bugsy

Usage

import * as bugsy from 'bugsy';

const RanAwayError = bugsy.create(
  'RanAwayError',
  'It ran away, again',
  { code: 'ran_away' }
);
const MissedThrowError = bugsy.create(
  'MissedThrowError',
  'Throw totally missed',
  { code: 'missed_throw' }
);

function capture() {
  if (Math.random() > 0.9) {
    throw new MissedThrowError();
  } else {
    throw new RanAwayError({ meta: 'Caterpie' }); 
  }
}

bugsy.transform(() => {
  capture();
}, [
  bugsy.code('missed_throw').drop(),
  bugsy.instanceOf(RanAwayError).transform(err => err.level = bugsy.LEVELS_SYSLOG.EMERGENCY)
]);

Licences

MIT

Keywords

FAQs

Package last updated on 25 Aug 2016

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