package
stackless unless otherwise requested error
npm install silent-errorGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
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-erroror
npm install --save silent-errorEstimated unpacked size across 3 packages.
51.7 kB
Includes dependencies.