code: 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);
        }
      }
    };
  }
docs: Handles parser internal errors
  @param  {Object} spec         [description]
  @param  {function} parsePayload [description]
  @return {async function}              [description]
  @api private