Socket
Socket
Sign inDemoInstall

combined-error

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    combined-error

Simple zero dependencies error for combining other errors, which ensures to have correct stack always


Version published
Weekly downloads
1
Maintainers
1
Install size
4.38 kB
Created
Weekly downloads
 

Readme

Source

CombinedError

Zero dependencies error that allow to combine other errors in cause chains. This is useful if you want to save original errors from other modules.

Example

var CE = require('combined-error');

var err1 = new CE(new Error('boom'), 'something bad 1');

console.log(err1.stack);

try { try { throw new Error('boom'); } catch(e) { throw new CE(e, 'something bad 2'); } } catch(e) { console.log(e.stack); }

Browsers

Tested in FF, Safari, Chrome, i do not have ability to test IE and Edge.

Node.js

Just require it.

License

MIT

Keywords

FAQs

Last updated on 07 Apr 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc