src/support/middleware/errorHandler.js
function() {
  let args = Array.prototype.slice.call(arguments),
    ErrorClass = args[0];

  if (_.isObject(ErrorClass)) {
    args.shift();
  } else {
    ErrorClass = errors.RuntimeError;
  }

  args.unshift(null);   // the this arg for the .bind() call

  throw new (Function.prototype.bind.apply(ErrorClass, args));
}
function() {
  let args = Array.prototype.slice.call(arguments),
    ErrorClass = args[0];

  if (_.isObject(ErrorClass)) {
    args.shift();
  } else {
    ErrorClass = errors.RuntimeError;
  }

  args.unshift(null);   // the this arg for the .bind() call

  throw new (Function.prototype.bind.apply(ErrorClass, args));
}
function ( ) { let args = Array . prototype . slice . call ( arguments ) , ErrorClass = args [ 0 ] ; if ( _ . isObject ( ErrorClass ) ) { args . shift ( ) ; } else { ErrorClass = errors . RuntimeError ; } args . unshift ( null ) ; // the this arg for the .bind() call throw new ( Function . prototype . bind . apply ( ErrorClass , args ) ) ; }
Throw an error
@param  {Class} [errorClass] Error class. Default is `RuntimeError`.
@param  {Any} ...       Additional arguments get passed to error class constructor.
@throws Error
Throw an error