1.0.3 • Published 4 years ago

inspector-with-exceptions v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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');
  }
}