support for chained innerError in custom errors
support for chained innerError in custom errors

var util = require('util');

function CustomError(ex, message) 
{
    Error.call(this);
    Error.captureStackTrace(this, this.constructor);

    this.innerError = ex;
    this.name = this.constructor.name;
    this.message = message
}
util.inherits(CustomError, Error);

new CustomError(new Error(), "chained error");
rollbar/node_rollbar,rollbar/node_rollbar