#include </data/code/userver/libraries/proto-structs/include/userver/proto-structs/io/context_base.hpp>
Read/write operation context with error information.
TError | error type |
Definition at line 48 of file context_base.hpp.
Public Types | |
using | Error = TError |
Public Member Functions | |
bool | HasErrors () const noexcept |
Returns true if context contains at least one error. | |
void | AddError (int field_number, std::string_view reason) |
Adds conversion error. | |
void | AddError (const ::google::protobuf::FieldDescriptor &field_desc, std::string_view reason) |
Adds conversion error Parameter field_desc contains protobuf message field descriptor for which conversion has failed. | |
void | AddError (std::string_view reason) |
Adds conversion error Method is intended for cases when it is hard to associate error with concrete field of the protobuf message. | |
Protected Member Functions | |
Context (const ::google::protobuf::Descriptor &message_desc) noexcept | |
std::string | GetCurrentPath (int current_field_number) const |
std::string | GetCurrentPath (const ::google::protobuf::FieldDescriptor ¤t_field_desc) const |
std::string | GetCurrentPath () const |
void | PopFromPath () |
void | PushToPath (int field_number) |
using proto_structs::io::ContextWithErrors< TError >::Error = TError |
Definition at line 50 of file context_base.hpp.
void proto_structs::io::ContextWithErrors< TError >::AddError | ( | const ::google::protobuf::FieldDescriptor & | field_desc, |
std::string_view | reason ) |
Adds conversion error Parameter field_desc contains protobuf message field descriptor for which conversion has failed.
Definition at line 87 of file context_base.cpp.
void proto_structs::io::ContextWithErrors< TError >::AddError | ( | int | field_number, |
std::string_view | reason ) |
Adds conversion error.
Error | exception Parameter field_number contains protobuf message field number for which conversion has failed. |
Definition at line 82 of file context_base.cpp.
void proto_structs::io::ContextWithErrors< TError >::AddError | ( | std::string_view | reason | ) |
Adds conversion error Method is intended for cases when it is hard to associate error with concrete field of the protobuf message.
Definition at line 95 of file context_base.cpp.
|
inlineexplicitprotectednoexcept |
Definition at line 29 of file context_base.hpp.
|
protected |
Definition at line 36 of file context_base.cpp.
|
protected |
Definition at line 35 of file context_base.cpp.
|
protected |
Definition at line 34 of file context_base.cpp.
|
inlinenoexcept |
Returns true
if context contains at least one error.
Definition at line 53 of file context_base.hpp.
|
inlineprotected |
Definition at line 32 of file context_base.hpp.
|
inlineprotected |
Definition at line 31 of file context_base.hpp.