index.js
function Exception(err, options) {
  if (!(this instanceof Exception)) return new Exception(err, options);
  if ('string' === typeof err) err = {
    stack: (new Error(err)).stack,
    message: err
  };

  debug('generating a new exception for: %s', err.message);

  options = options || {};
  this.initialize(options);

  this.message = err.message || 'An unknown Exception has occurred';
  this.timeout = options.timeout || 10000;
  this.stack = err.stack || '';
  this.human = !!options.human;

  this.filename = new Date().toDateString().split(' ').concat([
    this.appname,   // Name of the library or app that included us.
    process.pid,    // The current process id
    this.id         // Unique id for this exception.
  ]).filter(Boolean).join('-');

  this.capture = this.toJSON();
}
function Exception(err, options) {
  if (!(this instanceof Exception)) return new Exception(err, options);
  if ('string' === typeof err) err = {
    stack: (new Error(err)).stack,
    message: err
  };

  debug('generating a new exception for: %s', err.message);

  options = options || {};
  this.initialize(options);

  this.message = err.message || 'An unknown Exception has occurred';
  this.timeout = options.timeout || 10000;
  this.stack = err.stack || '';
  this.human = !!options.human;

  this.filename = new Date().toDateString().split(' ').concat([
    this.appname,   // Name of the library or app that included us.
    process.pid,    // The current process id
    this.id         // Unique id for this exception.
  ]).filter(Boolean).join('-');

  this.capture = this.toJSON();
}
function Exception ( err , options ) { if ( ! ( this instanceof Exception ) ) return new Exception ( err , options ) ; if ( 'string' === typeof err ) err = { stack : ( new Error ( err ) ) . stack , message : err } ; debug ( 'generating a new exception for: %s' , err . message ) ; options = options || { } ; this . initialize ( options ) ; this . message = err . message || 'An unknown Exception has occurred' ; this . timeout = options . timeout || 10000 ; this . stack = err . stack || '' ; this . human = ! ! options . human ; this . filename = new Date ( ) . toDateString ( ) . split ( ' ' ) . concat ( [ this . appname , // Name of the library or app that included us. process . pid , // The current process id this . id // Unique id for this exception. ] ) . filter ( Boolean ) . join ( '-' ) ; this . capture = this . toJSON ( ) ; }
Generates a new Exception.

Options:

- timeout: Timeout for remote saving data before we call the supplied
abortion callback.
- human: Provide a human readable console output.

@constructor
@param {Error} err The error that caused the exception.
@param {Object} options Configuration.
@api public
Generates a new Exception .