silent-error
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:
- command in your CLI tool is missing
- plugin to your build system is given invalid user-input.
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>
Example
// in one node module { // some logic throw `command: '' is not installed`;}
// in another node_module { try await ; catche SilentError; SilentErrordebugOrThrow}
Installation
yarn add silent-error
or
npm install --save silent-error