0.1.12 • Published 8 years ago

@gik/tools-thrower v0.1.12

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

@gik/tools-thrower 0.1.12

Errors with pretty stack and customizable name. Part of our tools suite.

Contributors
Supported platforms
  • linux
  • darwin

Table of contents

  • thrower Errors with pretty stack and customizable name.

thrower

Errors with pretty stack and customizable name.

Parameters
Returns

Error - A custom error instance with a pretty stack.

Example
Thrower('test'); // A standard Error with prettified stack
Thrower(new TypeError('test2')); // Standard TypeError with prettified stack
Thrower('test3', 'TestError'); // Custom TestError with 'test3' as message
Thrower(['hola %s', 'mundo'], 'HelloError'); // HelloError with 'hola mundo' as message
const Err = Thrower('bad boy', 'CanineError', false); // Returns CanineError instance.

▲ Top