cruks-lib-exception

1.1.0 • Public • Published

cruks-lib-exception

This package provides extendable Exception object

Example

Generic inheritance

var Exception = require("cruks-lib-exception").Exception;
 
function MyException (message, previous) {
    Exception.call(this, message, previous);
}
MyException.prototype = Object.create(Exception.prototype);
MyException.prototype.constructor = MyException;

Using Node.js util.inherits

var Exception = require("cruks-lib-exception").Exception,
    util = require("util");
 
function MyException (message, previous) {
    Exception.call(this, message, previous);
}
util.inherits(MyException, Exception);

Build Status Code Climate Dependency Status

/cruks-lib-exception/

    Package Sidebar

    Install

    npm i cruks-lib-exception

    Weekly Downloads

    22

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • mcharytoniuk