silent-error
stackless unless otherwise requested error
Last updated a year 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 (a year ago)

4 Versions

  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 88
This Week 586
This Month 2,866
Last Day 179
Last Week 892
Last Month 3,716
Dependencies (1)
Dev Dependencies (2)
Dependents (154)

Copyright 2014 - 2016 © taobao.org |