🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@etrigan/core

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@etrigan/core

Etrigan core

1.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

Etrigan Core

EtriganError

EtriganError allows us to provide meaningful error messages that retain context and have immutable identifiers for improved logging and alerting.

The error name should contain only letters and numbers, in upper-camel case. E.g. MyAppError

You might extend EtriganError to declare available errors ahead of time:

class MyAppError extends EtriganError {
    constructor(message: string, innerError?: Error) {
        super('MyAppError', message, innerError)
    }
}

Then use your error:

throw new MyAppError('a thing went wrong')

You should wrap errors from external APIs for additional context:

try {
    const foo = bar()
} catch (err) {
    throw new MyAppError('Cannot foo right now', err)
}

This will give us a nice, hearty log message:

MyAppError: Cannot foo right now: BarError: i can haz cheezburger?

FAQs

Package last updated on 19 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts