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

#include <userver/ugrpc/rich_status.hpp>

Detailed Description

Describes a single precondition violation.

See also
ugrpc::PreconditionFailure

Definition at line 192 of file rich_status.hpp.

Public Attributes

std::string type
 The type of precondition that failed (e.g., "TOS", "AGE").
 
std::string subject
 The subject on which the precondition failed (e.g., "user:123").
 
std::string description
 A description of how the precondition failed.
 

Member Data Documentation

◆ description

std::string ugrpc::PreconditionViolation::description

A description of how the precondition failed.

Developers can use this description to understand how to fix the failure. For Example usage: "Terms of service not accepted".

Definition at line 209 of file rich_status.hpp.

◆ subject

std::string ugrpc::PreconditionViolation::subject

The subject on which the precondition failed (e.g., "user:123").

For example, "google.com/cloud" relative to the "TOS" type would indicate which terms of service is being referenced.

Definition at line 203 of file rich_status.hpp.

◆ type

std::string ugrpc::PreconditionViolation::type

The type of precondition that failed (e.g., "TOS", "AGE").

Google recommends using a service-specific enum type to define the supported precondition violation subjects. For example, "TOS" for "Terms of Service violation".

Definition at line 197 of file rich_status.hpp.


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