errors.js
function ParserError(message, spark) {
  Error.captureStackTrace(this, this.constructor);

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

  if (spark) {
    if (spark.listeners('error').length) spark.emit('error', this);
    spark.primus.emit('log', 'error', this);
  }
}
function ParserError(message, spark) {
  Error.captureStackTrace(this, this.constructor);

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

  if (spark) {
    if (spark.listeners('error').length) spark.emit('error', this);
    spark.primus.emit('log', 'error', this);
  }
}
function ParserError ( message , spark ) { Error . captureStackTrace ( this , this . constructor ) ; this . message = message ; this . name = this . constructor . name ; if ( spark ) { if ( spark . listeners ( 'error' ) . length ) spark . emit ( 'error' , this ) ; spark . primus . emit ( 'log' , 'error' , this ) ; } }
There was an error while parsing incoming or outgoing data.

@param {String} message The reason for the error.
@param {Spark} spark The spark that caused the error.
@api public
There was an error while parsing incoming or outgoing data .