inspector-with-exceptions

1.0.3 • Public • Published

Install

$ npm install inspector-with-exceptions

Usage

import MyCustomException from './MyCustomException';

const Inspector = require('inspector-with-exceptions');

Example

import MyCustomException from './MyCustomException';

const Inspector = require('inspector-with-exceptions');

const value = null;

/**
 * Some logic
 */

try {
  Inspector.isNumber(value, 'Must be a number', MyCustomException);
} catch (e) {
  if (e instanceof MyCustomException) {
    console.log('MyCustomException');
  }
}

/inspector-with-exceptions/

    Package Sidebar

    Install

    npm i inspector-with-exceptions

    Weekly Downloads

    3

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    99.2 kB

    Total Files

    9

    Last publish

    Collaborators

    • doox911