silent-error

WebJar for silent-error

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

silent-error
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

silent-error
WebJar for silent-error
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ember-cli/silent-error

Download silent-error

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/silent-error/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>silent-error</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/silent-error/
implementation 'org.webjars.npm:silent-error:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/silent-error/
implementation ("org.webjars.npm:silent-error:1.1.0")
'org.webjars.npm:silent-error:jar:1.1.0'
<dependency org="org.webjars.npm" name="silent-error" rev="1.1.0">
  <artifact name="silent-error" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='silent-error', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "silent-error" % "1.1.0"
[org.webjars.npm/silent-error "1.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : debug jar [2.2.0,3)

Project Modules

There are no modules declared in this project.

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
org.webjars.npm

ember-cli

Versions

Version
1.1.0
1.0.0