1.1.0 • Published 10 years ago
cruks-lib-exception v1.1.0
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);