index.js
/**
 *  Default error wrapping implementation.
 *
 *  @param err Error instance or string.
 *  @param parameters Message replacement parameters.
 *  @param cause An error that caused this error.
 */
Default error wrapping implementation.
@param err Error instance or string.
@param parameters Message replacement parameters.
@param cause An error that caused this error.
Default error wrapping implementation . @param err Error instance or string . @param parameters Message replacement parameters . @param cause An error that caused this error .
function wrap(err) {
  if(err instanceof Error) {
    return err;
  }
  if(typeof err === 'string') {
    return new Error(err);
  }
  return new Error('unknown middleware error');
}
function wrap ( err ) { if ( err instanceof Error ) { return err ; } if ( typeof err === 'string' ) { return new Error ( err ) ; } return new Error ( 'unknown middleware error' ) ; }
Default error wrapping implementation.
Default error wrapping implementation .
/*, parameters, cause*/