
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
silent-error
Advanced tools
An error subclass for humanized errors. This module allows for inter-module detection of errors which are fatal, but where a stacktrace by default provides negative value.
Some use-cases:
Obviously stack traces can still be valuable. To view the stacks, the following environment variable can be set to true
SILENT_ERROR=verbose <run program>
// in one node module
async function runCommand(name) {
// some logic
throw new SilentError(`command: '${name}' is not installed`);
}
// in another node_module
async function caller() {
try {
await runCommand('foo');
} catch(e) {
SilentError.debugOrThrow(e);
}
SilentError.debugOrThrow
}
yarn add silent-error
or
npm install --save silent-error
The verror package provides a way to create and handle nested errors with additional context. It is more focused on error wrapping and providing detailed error messages compared to silent-error.
The custom-error-generator package allows you to create custom error types with additional properties. It is similar to silent-error in that it provides a way to create custom errors, but it offers more flexibility in defining error properties.
The create-error package is a simple utility for creating custom error types. It is similar to silent-error but focuses on simplicity and ease of use for creating custom errors.
FAQs
stackless unless otherwise requested error
The npm package silent-error receives a total of 232,890 weekly downloads. As such, silent-error popularity was classified as popular.
We found that silent-error demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.