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

nested-error-stacks

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nested-error-stacks

An Error subclass that will chain nested Errors and dump nested stacktraces

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8M
decreased by-4.58%
Maintainers
1
Weekly downloads
 
Created

What is nested-error-stacks?

The nested-error-stacks npm package is used to create Error objects in Node.js that can encapsulate and display a stack trace from another error. This is useful for debugging and error handling when you want to preserve the original error context while adding additional information or handling an error at a higher level in your application.

What are nested-error-stacks's main functionalities?

Creating nested errors

This feature allows developers to create a new error that includes the stack trace of a previous error. The code sample demonstrates how to catch an error and throw a new NestedError that includes the original error's stack trace.

const NestedError = require('nested-error-stacks');

function doSomethingRisky() {
  try {
    // Code that might throw an error
  } catch (error) {
    throw new NestedError('An error occurred in doSomethingRisky', error);
  }
}

Other packages similar to nested-error-stacks

Keywords

FAQs

Package last updated on 28 Mar 2022

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