19 #ifndef GRPC_CORE_LIB_GPRPP_STATUS_HELPER_H
20 #define GRPC_CORE_LIB_GPRPP_STATUS_HELPER_H
26 #include "absl/status/status.h"
27 #include "absl/time/time.h"
28 #include "absl/types/optional.h"
112 absl::StatusCode code, absl::string_view msg,
const DebugLocation& location,
124 absl::string_view value);
164 static constexpr uintptr_t kOkStatusPtr = 0;
struct google_rpc_Status google_rpc_Status
Definition: status.upb.h:24
::google::protobuf::util::Status Status
Definition: config_protobuf.h:91
google_rpc_Status * StatusToProto(absl::Status status, upb_arena *arena)
Builds a upb message, google_rpc_Status from a status This is for internal implementation & test only...
Definition: status_helper.cc:333
uintptr_t StatusAllocPtr(absl::Status s)
Returns ptr where the given status is copied into.
Definition: status_helper.cc:381
absl::Status StatusFromProto(google_rpc_Status *msg)
Builds a status from a upb message, google_rpc_Status This is for internal implementation & test only...
Definition: status_helper.cc:364
void StatusFreePtr(uintptr_t ptr)
Frees the allocated status at ptr.
Definition: status_helper.cc:395
absl::Status StatusGetFromPtr(uintptr_t ptr)
Get the status from ptr.
Definition: status_helper.cc:400
Round Robin Policy.
Definition: backend_metric.cc:26
void StatusSetInt(absl::Status *status, StatusIntProperty key, intptr_t value)
Sets the int property to the status.
Definition: status_helper.cc:178
std::vector< absl::Status > StatusGetChildren(absl::Status status)
Returns all children status from a status.
Definition: status_helper.cc:261
absl::optional< std::string > StatusGetStr(const absl::Status &status, StatusStrProperty key)
Gets the str property from the status.
Definition: status_helper.cc:208
void StatusSetStr(absl::Status *status, StatusStrProperty key, absl::string_view value)
Sets the str property to the status.
Definition: status_helper.cc:203
absl::optional< absl::Time > StatusGetTime(const absl::Status &status, StatusTimeProperty key)
Gets the time property from the status.
Definition: status_helper.cc:225
absl::optional< intptr_t > StatusGetInt(const absl::Status &status, StatusIntProperty key)
Gets the int property from the status.
Definition: status_helper.cc:183
StatusStrProperty
This enum should have the same value of grpc_error_strs.
Definition: status_helper.h:79
@ kFile
source file in which this error occurred
@ kKey
key associated with the error
@ kFilename
filename that we were trying to read/write when this error occurred
@ kDescription
top-level textual description of this error
@ kGrpcMessage
grpc status message associated with this error
@ kValue
value associated with the error
@ kRawBytes
hex dump (or similar) with the data that generated this error
@ kSyscall
syscall that generated this error
@ kOsError
operating system description of this error
@ kTargetAddress
peer that we were trying to communicate when this error occurred
@ kTsiError
tsi error string associated with this error
StatusTimeProperty
This enum should have the same value of grpc_error_times.
Definition: status_helper.h:105
@ kCreated
timestamp of error creation
std::string StatusToString(const absl::Status &status)
Returns a string representation from status Error status will be like STATUS[:MESSAGE] [{PAYLOADS[,...
Definition: status_helper.cc:267
void StatusAddChild(absl::Status *status, absl::Status child)
Adds a child status to status.
Definition: status_helper.cc:241
void StatusSetTime(absl::Status *status, StatusTimeProperty key, absl::Time time)
Sets the time property to the status.
Definition: status_helper.cc:218
absl::Status StatusCreate(absl::StatusCode code, absl::string_view msg, const DebugLocation &location, std::initializer_list< absl::Status > children)
Creates a status with given additional information.
Definition: status_helper.cc:159
StatusIntProperty
This enum should have the same value of grpc_error_ints.
Definition: status_helper.h:41
@ kLbPolicyDrop
LB policy drop.
@ kOffset
offset into some binary blob (usually represented by RAW_BYTES) where the error occurred
@ kStreamId
stream identifier: for errors that are associated with an individual wire stream
@ ChannelConnectivityState
channel connectivity state associated with the error
@ kSize
context sensitive size associated with the error
@ kHttp2Error
http2 error code associated with the error (see the HTTP2 RFC)
@ kHttpStatus
HTTP status (i.e. 404)
@ kFileLine
LINE from the call site creating the error
@ kErrorNo
'errno' from the operating system
@ kFd
File descriptor associated with this error.
@ kWsaError
WSAGetLastError() reported when this error occurred.
@ kIndex
context sensitive index associated with the error
@ kOccurredDuringWrite
chttp2: did the error occur while a write was in progress
@ kTsiCode
TSI status code associated with the error.
@ kRpcStatus
grpc status code representing this error
StatusCode
Definition: status_code_enum.h:24
upb_arena * arena
Definition: xds_api.cc:909