How to use the es6-error function in es6-error

To help you get started, we’ve selected a few es6-error examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / es6-error_v4.x.x / flow_v0.104.x- / test_es6-error_v4.x.x.js View on Github external
// @flow
import Error from 'es6-error';

new Error();
new Error('Ooups!');

class CustomError extends Error {
  customProperty: string = '';
}

const e = new CustomError();

e.name;
e.message;
e.stack;

e.customProperty;

// $ExpectError
e.wut;

es6-error

Easily-extendable error for use with ES6 classes

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis

Popular es6-error functions