silent-error
stackless unless otherwise requested error
Last updated 9 months ago by stefanpenner .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install silent-error 
SYNC missed versions from official npm registry.

silent-error Build Status

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
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
}

Installation

yarn add silent-error

or

npm install --save silent-error

Current Tags

  • 1.1.1                                ...           latest (9 months ago)

4 Versions

  • 1.1.1                                ...           9 months ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 3
This Week 3
This Month 3,277
Last Day 55
Last Week 1,072
Last Month 4,603
Dependencies (1)
Dev Dependencies (2)
Dependents (148)

Copyright 2014 - 2016 © taobao.org |