errors.js
function PrimusError(message, logger) {
  Error.captureStackTrace(this, this.constructor);

  this.message = message;
  this.name = this.constructor.name;

  if (logger) {
    logger.emit('log', 'error', this);
  }
}
function PrimusError(message, logger) {
  Error.captureStackTrace(this, this.constructor);

  this.message = message;
  this.name = this.constructor.name;

  if (logger) {
    logger.emit('log', 'error', this);
  }
}
function PrimusError ( message , logger ) { Error . captureStackTrace ( this , this . constructor ) ; this . message = message ; this . name = this . constructor . name ; if ( logger ) { logger . emit ( 'log' , 'error' , this ) ; } }
Generic Primus error.

@constructor
@param {String} message The reason for the error
@param {EventEmitter} logger Optional EventEmitter to emit a `log` event on.
@api public
Generic Primus error .