GRPC Core  18.0.0
Namespaces | Enumerations | Functions
status_helper.h File Reference
#include <grpc/support/port_platform.h>
#include <vector>
#include "absl/status/status.h"
#include "absl/time/time.h"
#include "absl/types/optional.h"
#include "src/core/lib/gprpp/debug_location.h"

Go to the source code of this file.

Namespaces

 grpc_core
 Round Robin Policy.
 
 grpc_core::internal
 

Enumerations

enum class  grpc_core::StatusIntProperty {
  grpc_core::kErrorNo , grpc_core::kFileLine , grpc_core::kStreamId , grpc_core::kRpcStatus ,
  grpc_core::kOffset , grpc_core::kIndex , grpc_core::kSize , grpc_core::kHttp2Error ,
  grpc_core::kTsiCode , grpc_core::kWsaError , grpc_core::kFd , grpc_core::kHttpStatus ,
  grpc_core::kOccurredDuringWrite , grpc_core::ChannelConnectivityState , grpc_core::kLbPolicyDrop
}
 This enum should have the same value of grpc_error_ints. More...
 
enum class  grpc_core::StatusStrProperty {
  grpc_core::kDescription , grpc_core::kFile , grpc_core::kOsError , grpc_core::kSyscall ,
  grpc_core::kTargetAddress , grpc_core::kGrpcMessage , grpc_core::kRawBytes , grpc_core::kTsiError ,
  grpc_core::kFilename , grpc_core::kKey , grpc_core::kValue
}
 This enum should have the same value of grpc_error_strs. More...
 
enum class  grpc_core::StatusTimeProperty { grpc_core::kCreated }
 This enum should have the same value of grpc_error_times. More...
 

Functions

absl::Status grpc_core::StatusCreate (absl::StatusCode code, absl::string_view msg, const DebugLocation &location, std::initializer_list< absl::Status > children) GRPC_MUST_USE_RESULT
 Creates a status with given additional information. More...
 
void grpc_core::StatusSetInt (absl::Status *status, StatusIntProperty key, intptr_t value)
 Sets the int property to the status. More...
 
absl::optional< intptr_t > grpc_core::StatusGetInt (const absl::Status &status, StatusIntProperty key) GRPC_MUST_USE_RESULT
 Gets the int property from the status. More...
 
void grpc_core::StatusSetStr (absl::Status *status, StatusStrProperty key, absl::string_view value)
 Sets the str property to the status. More...
 
absl::optional< std::string > grpc_core::StatusGetStr (const absl::Status &status, StatusStrProperty key) GRPC_MUST_USE_RESULT
 Gets the str property from the status. More...
 
void grpc_core::StatusSetTime (absl::Status *status, StatusTimeProperty key, absl::Time time)
 Sets the time property to the status. More...
 
absl::optional< absl::Time > grpc_core::StatusGetTime (const absl::Status &status, StatusTimeProperty key) GRPC_MUST_USE_RESULT
 Gets the time property from the status. More...
 
void grpc_core::StatusAddChild (absl::Status *status, absl::Status child)
 Adds a child status to status. More...
 
std::vector< absl::Status > grpc_core::StatusGetChildren (absl::Status status) GRPC_MUST_USE_RESULT
 Returns all children status from a status. More...
 
std::string grpc_core::StatusToString (const absl::Status &status) GRPC_MUST_USE_RESULT
 Returns a string representation from status Error status will be like STATUS[:MESSAGE] [{PAYLOADS[, children:[CHILDREN-STATUS-LISTS]]}] e.g. More...
 
google_rpc_Statusgrpc_core::internal::StatusToProto (absl::Status status, upb_arena *arena) GRPC_MUST_USE_RESULT
 Builds a upb message, google_rpc_Status from a status This is for internal implementation & test only. More...
 
absl::Status grpc_core::internal::StatusFromProto (google_rpc_Status *msg) GRPC_MUST_USE_RESULT
 Builds a status from a upb message, google_rpc_Status This is for internal implementation & test only. More...
 
uintptr_t grpc_core::internal::StatusAllocPtr (absl::Status s)
 Returns ptr where the given status is copied into. More...
 
void grpc_core::internal::StatusFreePtr (uintptr_t ptr)
 Frees the allocated status at ptr. More...
 
absl::Status grpc_core::internal::StatusGetFromPtr (uintptr_t ptr)
 Get the status from ptr. More...