joi-router.js
function wrapError(spec, parsePayload) {
  return async function errorHandler(ctx, next) {
    try {
      await parsePayload(ctx, next);
    } catch (err) {
      captureError(ctx, 'type', err);
      if (spec.validate.continueOnError) {
        return await next();
      } else {
        return ctx.throw(err);
      }
    }
  };
}
function wrapError(spec, parsePayload) {
  return async function errorHandler(ctx, next) {
    try {
      await parsePayload(ctx, next);
    } catch (err) {
      captureError(ctx, 'type', err);
      if (spec.validate.continueOnError) {
        return await next();
      } else {
        return ctx.throw(err);
      }
    }
  };
}
function wrapError ( spec , parsePayload ) { return async function errorHandler ( ctx , next ) { try { await parsePayload ( ctx , next ) ; } catch ( err ) { captureError ( ctx , 'type' , err ) ; if ( spec . validate . continueOnError ) { return await next ( ) ; } else { return ctx . throw ( err ) ; } } } ; }
Handles parser internal errors
@param  {Object} spec         [description]
@param  {function} parsePayload [description]
@return {async function}              [description]
@api private
Handles parser internal errors