GRPC C++  1.39.1
Namespaces | Macros | Functions
status_helper.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/gprpp/time_util.h"
#include <grpc/support/log.h>
#include "absl/strings/cord.h"
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "absl/time/clock.h"
#include "google/protobuf/any.upb.h"
#include "google/rpc/status.upb.h"
#include "upb/upb.hpp"

Namespaces

 grpc_core
 Round Robin Policy.
 
 grpc_core::internal
 

Macros

#define TYPE_URL_PREFIX   "type.googleapis.com/grpc.status."
 
#define TYPE_INT_TAG   "int."
 
#define TYPE_STR_TAG   "str."
 
#define TYPE_TIME_TAG   "time."
 
#define TYPE_CHILDREN_TAG   "children"
 
#define TYPE_URL(name)   (TYPE_URL_PREFIX name)
 

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...
 

Macro Definition Documentation

◆ TYPE_CHILDREN_TAG

#define TYPE_CHILDREN_TAG   "children"

◆ TYPE_INT_TAG

#define TYPE_INT_TAG   "int."

◆ TYPE_STR_TAG

#define TYPE_STR_TAG   "str."

◆ TYPE_TIME_TAG

#define TYPE_TIME_TAG   "time."

◆ TYPE_URL

#define TYPE_URL (   name)    (TYPE_URL_PREFIX name)

◆ TYPE_URL_PREFIX

#define TYPE_URL_PREFIX   "type.googleapis.com/grpc.status."