24void Middleware::PostRecvMessage(
25 ugrpc::client::MiddlewareCallContext& context,
26 const google::protobuf::Message& message
28 const auto& settings = settings_.Get(context.GetCallName());
29 google::protobuf::Arena arena;
31 auto validator = validator_factory_->NewValidator(&arena, settings.fail_fast);
32 auto result = validator.Validate(message);
37 LOG_ERROR() <<
"Validator internal error (check response constraints in the proto file): " << result.status();
38 throw ValidatorError(context.GetCallName());
39 }
else if (result.value().violations_size() > 0) {
40 for (
const auto& violation : result.value().violations()) {
41 LOG_ERROR() <<
"Response constraint violation: " << violation.proto();
44 throw ResponseError(context.GetCallName(), std::move(result).value());