userver: ugrpc::PreconditionFailure Struct Reference
Loading...
Searching...
No Matches
ugrpc::PreconditionFailure Struct Reference

#include <userver/ugrpc/rich_status.hpp>

Detailed Description

Describes preconditions that failed during request processing.

See also
https:///github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto
ugrpc::RichStatus

For example, if an RPC failed because it required the Terms of Service to be acknowledged, it could list the terms of service violation in the PreconditionFailure message.

Example usage:

grpc::StatusCode::FAILED_PRECONDITION,
"Preconditions not met",
{"TOS", "user:alice@example.com", "Terms of service not accepted"},
{"EMAIL_VERIFIED", "user:alice@example.com", "Email not verified"},
}},
};

Definition at line 223 of file rich_status.hpp.

Public Member Functions

google::rpc::PreconditionFailure ToGoogleErrorDetail () const &
 
google::rpc::PreconditionFailure ToGoogleErrorDetail () &&
 

Static Public Member Functions

static std::optional< PreconditionFailureTryUnpack (const google::protobuf::Any &any)
 

Public Attributes

std::vector< PreconditionViolationviolations
 The list of precondition violations.
 

Member Data Documentation

◆ violations

std::vector<PreconditionViolation> ugrpc::PreconditionFailure::violations

The list of precondition violations.

Definition at line 225 of file rich_status.hpp.


The documentation for this struct was generated from the following file: