status_helper.cc
Go to the documentation of this file.
1 //
2 //
3 // Copyright 2021 the gRPC authors.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 //
18 
20 
22 
23 #include <string.h>
24 
25 #include <algorithm>
26 #include <utility>
27 
28 #include "absl/strings/cord.h"
29 #include "absl/strings/escaping.h"
30 #include "absl/strings/match.h"
31 #include "absl/strings/numbers.h"
32 #include "absl/strings/str_cat.h"
33 #include "absl/strings/str_join.h"
34 #include "absl/time/clock.h"
36 #include "google/rpc/status.upb.h"
37 #include "upb/upb.h"
38 #include "upb/upb.hpp"
39 
40 #include <grpc/support/log.h>
41 
44 
45 namespace grpc_core {
46 
47 namespace {
48 
49 #define TYPE_URL_PREFIX "type.googleapis.com/grpc.status."
50 #define TYPE_INT_TAG "int."
51 #define TYPE_STR_TAG "str."
52 #define TYPE_TIME_TAG "time."
53 #define TYPE_CHILDREN_TAG "children"
54 #define TYPE_URL(name) (TYPE_URL_PREFIX name)
56 const absl::string_view kTypeIntTag = TYPE_INT_TAG;
57 const absl::string_view kTypeStrTag = TYPE_STR_TAG;
58 const absl::string_view kTypeTimeTag = TYPE_TIME_TAG;
59 const absl::string_view kTypeChildrenTag = TYPE_CHILDREN_TAG;
60 const absl::string_view kChildrenPropertyUrl = TYPE_URL(TYPE_CHILDREN_TAG);
61 
62 const char* GetStatusIntPropertyUrl(StatusIntProperty key) {
63  switch (key) {
65  return TYPE_URL(TYPE_INT_TAG "errno");
67  return TYPE_URL(TYPE_INT_TAG "file_line");
69  return TYPE_URL(TYPE_INT_TAG "stream_id");
71  return TYPE_URL(TYPE_INT_TAG "grpc_status");
73  return TYPE_URL(TYPE_INT_TAG "offset");
75  return TYPE_URL(TYPE_INT_TAG "index");
77  return TYPE_URL(TYPE_INT_TAG "size");
79  return TYPE_URL(TYPE_INT_TAG "http2_error");
81  return TYPE_URL(TYPE_INT_TAG "tsi_code");
83  return TYPE_URL(TYPE_INT_TAG "wsa_error");
85  return TYPE_URL(TYPE_INT_TAG "fd");
87  return TYPE_URL(TYPE_INT_TAG "http_status");
89  return TYPE_URL(TYPE_INT_TAG "occurred_during_write");
91  return TYPE_URL(TYPE_INT_TAG "channel_connectivity_state");
93  return TYPE_URL(TYPE_INT_TAG "lb_policy_drop");
94  }
95  GPR_UNREACHABLE_CODE(return "unknown");
96 }
97 
98 const char* GetStatusStrPropertyUrl(StatusStrProperty key) {
99  switch (key) {
101  return TYPE_URL(TYPE_STR_TAG "description");
103  return TYPE_URL(TYPE_STR_TAG "file");
105  return TYPE_URL(TYPE_STR_TAG "os_error");
107  return TYPE_URL(TYPE_STR_TAG "syscall");
109  return TYPE_URL(TYPE_STR_TAG "target_address");
111  return TYPE_URL(TYPE_STR_TAG "grpc_message");
113  return TYPE_URL(TYPE_STR_TAG "raw_bytes");
115  return TYPE_URL(TYPE_STR_TAG "tsi_error");
117  return TYPE_URL(TYPE_STR_TAG "filename");
119  return TYPE_URL(TYPE_STR_TAG "key");
121  return TYPE_URL(TYPE_STR_TAG "value");
122  }
123  GPR_UNREACHABLE_CODE(return "unknown");
124 }
125 
126 const char* GetStatusTimePropertyUrl(StatusTimeProperty key) {
127  switch (key) {
129  return TYPE_URL(TYPE_TIME_TAG "created_time");
130  }
131  GPR_UNREACHABLE_CODE(return "unknown");
132 }
133 
134 void EncodeUInt32ToBytes(uint32_t v, char* buf) {
135  buf[0] = v & 0xFF;
136  buf[1] = (v >> 8) & 0xFF;
137  buf[2] = (v >> 16) & 0xFF;
138  buf[3] = (v >> 24) & 0xFF;
139 }
140 
141 uint32_t DecodeUInt32FromBytes(const char* buf) {
142  const unsigned char* ubuf = reinterpret_cast<const unsigned char*>(buf);
143  return ubuf[0] | (uint32_t(ubuf[1]) << 8) | (uint32_t(ubuf[2]) << 16) |
144  (uint32_t(ubuf[3]) << 24);
145 }
146 
147 std::vector<absl::Status> ParseChildren(absl::Cord children) {
148  std::vector<absl::Status> result;
150  // Cord is flattened to iterate the buffer easily at the cost of memory copy.
151  // TODO(veblush): Optimize this once CordReader is introduced.
152  absl::string_view buf = children.Flatten();
153  size_t cur = 0;
154  while (buf.size() - cur >= sizeof(uint32_t)) {
155  size_t msg_size = DecodeUInt32FromBytes(buf.data() + cur);
156  cur += sizeof(uint32_t);
157  GPR_ASSERT(buf.size() - cur >= msg_size);
159  google_rpc_Status_parse(buf.data() + cur, msg_size, arena.ptr());
160  cur += msg_size;
162  }
163  return result;
164 }
165 
166 } // namespace
167 
169  const DebugLocation& location,
170  std::vector<absl::Status> children) {
171  absl::Status s(code, msg);
172  if (location.file() != nullptr) {
173  StatusSetStr(&s, StatusStrProperty::kFile, location.file());
174  }
175  if (location.line() != -1) {
177  }
179  for (const absl::Status& child : children) {
180  if (!child.ok()) {
181  StatusAddChild(&s, child);
182  }
183  }
184  return s;
185 }
186 
188  status->SetPayload(GetStatusIntPropertyUrl(key),
190 }
191 
195  status.GetPayload(GetStatusIntPropertyUrl(key));
196  if (p.has_value()) {
197  absl::optional<absl::string_view> sv = p->TryFlat();
198  intptr_t value;
199  if (sv.has_value()) {
200  if (absl::SimpleAtoi(*sv, &value)) {
201  return value;
202  }
203  } else {
204  if (absl::SimpleAtoi(std::string(*p), &value)) {
205  return value;
206  }
207  }
208  }
209  return {};
210 }
211 
214  status->SetPayload(GetStatusStrPropertyUrl(key), absl::Cord(value));
215 }
216 
220  status.GetPayload(GetStatusStrPropertyUrl(key));
221  if (p.has_value()) {
222  return std::string(*p);
223  }
224  return {};
225 }
226 
228  absl::Time time) {
229  std::string time_str =
231  status->SetPayload(GetStatusTimePropertyUrl(key),
232  absl::Cord(std::move(time_str)));
233 }
234 
238  status.GetPayload(GetStatusTimePropertyUrl(key));
239  if (p.has_value()) {
240  absl::optional<absl::string_view> sv = p->TryFlat();
241  absl::Time time;
242  if (sv.has_value()) {
243  if (absl::ParseTime(absl::RFC3339_full, sv.value(), &time, nullptr)) {
244  return time;
245  }
246  } else {
247  std::string s = std::string(*p);
248  if (absl::ParseTime(absl::RFC3339_full, s, &time, nullptr)) {
249  return time;
250  }
251  }
252  }
253  return {};
254 }
255 
258  // Serialize msg to buf
260  size_t buf_len = 0;
261  char* buf = google_rpc_Status_serialize(msg, arena.ptr(), &buf_len);
262  // Append (msg-length and msg) to children payload
263  absl::optional<absl::Cord> old_children =
264  status->GetPayload(kChildrenPropertyUrl);
266  if (old_children.has_value()) {
267  children = *old_children;
268  }
269  char head_buf[sizeof(uint32_t)];
270  EncodeUInt32ToBytes(buf_len, head_buf);
271  children.Append(absl::string_view(head_buf, sizeof(uint32_t)));
272  children.Append(absl::string_view(buf, buf_len));
273  status->SetPayload(kChildrenPropertyUrl, std::move(children));
274 }
275 
276 std::vector<absl::Status> StatusGetChildren(absl::Status status) {
277  absl::optional<absl::Cord> children = status.GetPayload(kChildrenPropertyUrl);
278  return children.has_value() ? ParseChildren(*children)
279  : std::vector<absl::Status>();
280 }
281 
283  if (status.ok()) {
284  return "OK";
285  }
286  std::string head;
288  if (!status.message().empty()) {
289  absl::StrAppend(&head, ":", status.message());
290  }
291  std::vector<std::string> kvs;
294  const absl::Cord& payload) {
296  type_url.remove_prefix(kTypeUrlPrefix.size());
297  if (type_url == kTypeChildrenTag) {
298  children = payload;
299  return;
300  }
301  absl::string_view payload_view;
302  std::string payload_storage;
303  if (payload.TryFlat().has_value()) {
304  payload_view = payload.TryFlat().value();
305  } else {
306  payload_storage = std::string(payload);
307  payload_view = payload_storage;
308  }
309  if (absl::StartsWith(type_url, kTypeIntTag)) {
310  type_url.remove_prefix(kTypeIntTag.size());
311  kvs.push_back(absl::StrCat(type_url, ":", payload_view));
312  } else if (absl::StartsWith(type_url, kTypeStrTag)) {
313  type_url.remove_prefix(kTypeStrTag.size());
314  kvs.push_back(absl::StrCat(type_url, ":\"",
315  absl::CHexEscape(payload_view), "\""));
316  } else if (absl::StartsWith(type_url, kTypeTimeTag)) {
317  type_url.remove_prefix(kTypeTimeTag.size());
318  absl::Time t;
319  if (absl::ParseTime(absl::RFC3339_full, payload_view, &t, nullptr)) {
320  kvs.push_back(
321  absl::StrCat(type_url, ":\"", absl::FormatTime(t), "\""));
322  } else {
323  kvs.push_back(absl::StrCat(type_url, ":\"",
324  absl::CHexEscape(payload_view), "\""));
325  }
326  } else {
327  kvs.push_back(absl::StrCat(type_url, ":\"",
328  absl::CHexEscape(payload_view), "\""));
329  }
330  } else {
331  absl::optional<absl::string_view> payload_view = payload.TryFlat();
332  std::string payload_str = absl::CHexEscape(
333  payload_view.has_value() ? *payload_view : std::string(payload));
334  kvs.push_back(absl::StrCat(type_url, ":\"", payload_str, "\""));
335  }
336  });
337  if (children.has_value()) {
338  std::vector<absl::Status> children_status = ParseChildren(*children);
339  std::vector<std::string> children_text;
340  children_text.reserve(children_status.size());
341  for (const absl::Status& child_status : children_status) {
342  children_text.push_back(StatusToString(child_status));
343  }
344  kvs.push_back(
345  absl::StrCat("children:[", absl::StrJoin(children_text, ", "), "]"));
346  }
347  return kvs.empty() ? head
348  : absl::StrCat(head, " {", absl::StrJoin(kvs, ", "), "}");
349 }
350 
351 namespace internal {
352 
356  // Protobuf string field requires to be utf-8 encoding but C++ string doesn't
357  // this requirement so it can be a non utf-8 string. So it should be converted
358  // to a percent-encoded string to keep it as a utf-8 string.
359  Slice message_percent_slice =
362  char* message_percent = reinterpret_cast<char*>(
363  upb_Arena_Malloc(arena, message_percent_slice.length()));
364  if (message_percent_slice.length() > 0) {
365  memcpy(message_percent, message_percent_slice.data(),
366  message_percent_slice.length());
367  }
369  msg, upb_StringView_FromDataAndSize(message_percent,
370  message_percent_slice.length()));
372  const absl::Cord& payload) {
374  char* type_url_buf =
375  reinterpret_cast<char*>(upb_Arena_Malloc(arena, type_url.size()));
376  memcpy(type_url_buf, type_url.data(), type_url.size());
378  any, upb_StringView_FromDataAndSize(type_url_buf, type_url.size()));
379  absl::optional<absl::string_view> v_view = payload.TryFlat();
380  if (v_view.has_value()) {
382  any, upb_StringView_FromDataAndSize(v_view->data(), v_view->size()));
383  } else {
384  char* buf =
385  reinterpret_cast<char*>(upb_Arena_Malloc(arena, payload.size()));
386  char* cur = buf;
387  for (absl::string_view chunk : payload.Chunks()) {
388  memcpy(cur, chunk.data(), chunk.size());
389  cur += chunk.size();
390  }
393  }
394  });
395  return msg;
396 }
397 
400  upb_StringView message_percent_upb = google_rpc_Status_message(msg);
401  Slice message_percent_slice = Slice::FromExternalString(
402  absl::string_view(message_percent_upb.data, message_percent_upb.size));
403  Slice message_slice =
404  PermissivePercentDecodeSlice(std::move(message_percent_slice));
406  static_cast<absl::StatusCode>(code),
407  absl::string_view(reinterpret_cast<const char*>(message_slice.data()),
408  message_slice.size()));
409  size_t detail_len;
410  const google_protobuf_Any* const* details =
411  google_rpc_Status_details(msg, &detail_len);
412  for (size_t i = 0; i < detail_len; i++) {
416  absl::Cord(absl::string_view(value.data, value.size)));
417  }
418  return status;
419 }
420 
422  if (s.ok()) return 0;
423  absl::Status* ptr = new absl::Status(s);
424  return reinterpret_cast<uintptr_t>(ptr);
425 }
426 
428  absl::Status* s = reinterpret_cast<absl::Status*>(ptr);
429  delete s;
430 }
431 
433  if (ptr == 0) {
434  return absl::OkStatus();
435  } else {
436  return *reinterpret_cast<absl::Status*>(ptr);
437  }
438 }
439 
441  if (ptr == 0) {
442  return absl::OkStatus();
443  } else {
444  absl::Status* s = reinterpret_cast<absl::Status*>(ptr);
445  absl::Status ret = std::move(*s);
446  delete s;
447  return ret;
448  }
449 }
450 
451 } // namespace internal
452 
453 } // namespace grpc_core
google_rpc_Status
struct google_rpc_Status google_rpc_Status
Definition: google/rpc/status.upb.h:24
grpc_core::internal::StatusFromProto
absl::Status StatusFromProto(google_rpc_Status *msg)
Definition: status_helper.cc:398
TYPE_URL
#define TYPE_URL(name)
Definition: status_helper.cc:54
ptr
char * ptr
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:45
grpc_core::StatusIntProperty::kStreamId
@ kStreamId
grpc_core::PermissivePercentDecodeSlice
Slice PermissivePercentDecodeSlice(Slice slice_in)
Definition: percent_encoding.cc:130
slice.h
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
absl::Cord
Definition: abseil-cpp/absl/strings/cord.h:150
status.upb.h
grpc_core::StatusIntProperty::kFileLine
@ kFileLine
LINE from the call site creating the error
TYPE_INT_TAG
#define TYPE_INT_TAG
Definition: status_helper.cc:50
log.h
google_rpc_Status_code
UPB_INLINE int32_t google_rpc_Status_code(const google_rpc_Status *msg)
Definition: google/rpc/status.upb.h:65
absl::StrAppend
void StrAppend(std::string *dest, const AlphaNum &a)
Definition: abseil-cpp/absl/strings/str_cat.cc:193
grpc_core::StatusIntProperty::kRpcStatus
@ kRpcStatus
grpc status code representing this error
grpc_core::DebugLocation
Definition: debug_location.h:31
grpc_core::StatusStrProperty::kRawBytes
@ kRawBytes
hex dump (or similar) with the data that generated this error
absl::StrCat
std::string StrCat(const AlphaNum &a, const AlphaNum &b)
Definition: abseil-cpp/absl/strings/str_cat.cc:98
grpc_core::StatusGetChildren
std::vector< absl::Status > StatusGetChildren(absl::Status status)
Returns all children status from a status.
Definition: status_helper.cc:276
grpc_core::StatusIntProperty::kTsiCode
@ kTsiCode
TSI status code associated with the error.
absl::Time
Definition: third_party/abseil-cpp/absl/time/time.h:642
TYPE_CHILDREN_TAG
#define TYPE_CHILDREN_TAG
Definition: status_helper.cc:53
grpc_core
Definition: call_metric_recorder.h:31
grpc_core::StatusStrProperty::kFile
@ kFile
source file in which this error occurred
grpc_core::StatusAddChild
void StatusAddChild(absl::Status *status, absl::Status child)
Adds a child status to status.
Definition: status_helper.cc:256
grpc_core::StatusStrProperty::kOsError
@ kOsError
operating system description of this error
upb_StringView::data
const char * data
Definition: upb/upb/upb.h:73
grpc_core::Slice
Definition: src/core/lib/slice/slice.h:282
absl::StatusCodeToString
ABSL_NAMESPACE_BEGIN std::string StatusCodeToString(StatusCode code)
Definition: third_party/abseil-cpp/absl/status/status.cc:33
string.h
grpc_core::internal::StatusAllocHeapPtr
uintptr_t StatusAllocHeapPtr(absl::Status s)
Definition: status_helper.cc:421
google_rpc_Status_add_details
UPB_INLINE struct google_protobuf_Any * google_rpc_Status_add_details(google_rpc_Status *msg, upb_Arena *arena)
Definition: google/rpc/status.upb.h:96
grpc_core::StatusIntProperty::kOffset
@ kOffset
absl::StartsWith
bool StartsWith(absl::string_view text, absl::string_view prefix) noexcept
Definition: third_party/abseil-cpp/absl/strings/match.h:58
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_core::StatusTimeProperty::kCreated
@ kCreated
timestamp of error creation
grpc_core::StatusSetTime
void StatusSetTime(absl::Status *status, StatusTimeProperty key, absl::Time time)
Sets the time property to the status.
Definition: status_helper.cc:227
absl::OkStatus
Status OkStatus()
Definition: third_party/abseil-cpp/absl/status/status.h:882
grpc_core::StatusIntProperty::kLbPolicyDrop
@ kLbPolicyDrop
LB policy drop.
status
absl::Status status
Definition: rls.cc:251
grpc_core::StatusCreate
absl::Status StatusCreate(absl::StatusCode code, absl::string_view msg, const DebugLocation &location, std::vector< absl::Status > children)
Creates a status with given additional information.
Definition: status_helper.cc:168
grpc_core::StatusStrProperty::kTsiError
@ kTsiError
tsi error string associated with this error
absl::UTCTimeZone
TimeZone UTCTimeZone()
Definition: third_party/abseil-cpp/absl/time/time.h:1099
grpc_core::PercentEncodingType::Compatible
@ Compatible
grpc_core::StatusStrProperty::kSyscall
@ kSyscall
syscall that generated this error
google_protobuf_Any_set_type_url
UPB_INLINE void google_protobuf_Any_set_type_url(google_protobuf_Any *msg, upb_StringView value)
Definition: any.upb.h:73
grpc_core::DebugLocation::file
const char * file() const
Definition: debug_location.h:34
status_helper.h
grpc_core::StatusGetStr
absl::optional< std::string > StatusGetStr(const absl::Status &status, StatusStrProperty key)
Gets the str property from the status.
Definition: status_helper.cc:217
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
TYPE_TIME_TAG
#define TYPE_TIME_TAG
Definition: status_helper.cc:52
absl::FormatTime
std::string FormatTime(absl::string_view format, absl::Time t, absl::TimeZone tz)
Definition: abseil-cpp/absl/time/format.cc:74
google_protobuf_Any
struct google_protobuf_Any google_protobuf_Any
Definition: any.upb.h:24
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google_rpc_Status_parse
UPB_INLINE google_rpc_Status * google_rpc_Status_parse(const char *buf, size_t size, upb_Arena *arena)
Definition: google/rpc/status.upb.h:36
absl::SimpleAtoi
ABSL_NAMESPACE_BEGIN ABSL_MUST_USE_RESULT bool SimpleAtoi(absl::string_view str, int_type *out)
Definition: abseil-cpp/absl/strings/numbers.h:271
memcpy
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
grpc_core::StatusSetInt
void StatusSetInt(absl::Status *status, StatusIntProperty key, intptr_t value)
Sets the int property to the status.
Definition: status_helper.cc:187
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
absl::StrJoin
std::string StrJoin(Iterator start, Iterator end, absl::string_view sep, Formatter &&fmt)
Definition: abseil-cpp/absl/strings/str_join.h:239
absl::string_view::size
constexpr size_type size() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:277
absl::optional::has_value
constexpr bool has_value() const noexcept
Definition: abseil-cpp/absl/types/optional.h:461
grpc_core::DebugLocation::line
int line() const
Definition: debug_location.h:35
upb_StringView::size
size_t size
Definition: upb/upb/upb.h:74
grpc_core::StatusToString
std::string StatusToString(const absl::Status &status)
Definition: status_helper.cc:282
upb.h
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
upb_Arena_Malloc
UPB_INLINE void * upb_Arena_Malloc(upb_Arena *a, size_t size)
Definition: upb/upb/upb.h:222
grpc_core::StatusStrProperty::kFilename
@ kFilename
filename that we were trying to read/write when this error occurred
absl::Status::SetPayload
void SetPayload(absl::string_view type_url, absl::Cord payload)
Definition: third_party/abseil-cpp/absl/status/status.cc:128
absl::ParseTime
bool ParseTime(absl::string_view format, absl::string_view input, absl::Time *time, std::string *err)
Definition: abseil-cpp/absl/time/format.cc:91
absl::Status::message
absl::string_view message() const
Definition: third_party/abseil-cpp/absl/status/status.h:806
grpc_core::internal::StatusGetFromHeapPtr
absl::Status StatusGetFromHeapPtr(uintptr_t ptr)
Get the status from a heap ptr.
Definition: status_helper.cc:432
absl::RFC3339_full
ABSL_NAMESPACE_BEGIN const ABSL_DLL char RFC3339_full[]
Definition: third_party/abseil-cpp/absl/time/time.h:1261
absl::optional
Definition: abseil-cpp/absl/types/internal/optional.h:61
grpc_core::slice_detail::BaseSlice::data
const uint8_t * data() const
Definition: src/core/lib/slice/slice.h:99
grpc_core::StatusIntProperty::kWsaError
@ kWsaError
WSAGetLastError() reported when this error occurred.
googletest-filter-unittest.child
child
Definition: bloaty/third_party/googletest/googletest/test/googletest-filter-unittest.py:62
grpc_core::slice_detail::BaseSlice::size
size_t size() const
Definition: src/core/lib/slice/slice.h:102
intptr_t
_W64 signed int intptr_t
Definition: stdint-msvc2008.h:118
grpc_core::StatusSetStr
void StatusSetStr(absl::Status *status, StatusStrProperty key, absl::string_view value)
Sets the str property to the status.
Definition: status_helper.cc:212
TYPE_STR_TAG
#define TYPE_STR_TAG
Definition: status_helper.cc:51
grpc_core::StatusStrProperty::kDescription
@ kDescription
top-level textual description of this error
uintptr_t
_W64 unsigned int uintptr_t
Definition: stdint-msvc2008.h:119
GPR_UNREACHABLE_CODE
#define GPR_UNREACHABLE_CODE(STATEMENT)
Definition: impl/codegen/port_platform.h:652
grpc_core::internal::StatusFreeHeapPtr
void StatusFreeHeapPtr(uintptr_t ptr)
Frees the allocated status at heap ptr.
Definition: status_helper.cc:427
grpc_core::StatusIntProperty::ChannelConnectivityState
@ ChannelConnectivityState
channel connectivity state associated with the error
absl::CHexEscape
std::string CHexEscape(absl::string_view src)
Definition: abseil-cpp/absl/strings/escaping.cc:860
google_rpc_Status_details
UPB_INLINE const struct google_protobuf_Any *const * google_rpc_Status_details(const google_rpc_Status *msg, size_t *len)
Definition: google/rpc/status.upb.h:80
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
grpc_core::StatusStrProperty::kValue
@ kValue
value associated with the error
grpc_core::StatusTimeProperty
StatusTimeProperty
This enum should have the same value of grpc_error_times.
Definition: status_helper.h:109
absl::Status::ForEachPayload
void ForEachPayload(absl::FunctionRef< void(absl::string_view, const absl::Cord &)> visitor) const
Definition: third_party/abseil-cpp/absl/status/status.cc:166
grpc_core::internal::StatusToProto
google_rpc_Status * StatusToProto(const absl::Status &status, upb_Arena *arena)
Definition: status_helper.cc:353
google_rpc_Status_set_message
UPB_INLINE void google_rpc_Status_set_message(google_rpc_Status *msg, upb_StringView value)
Definition: google/rpc/status.upb.h:87
TYPE_URL_PREFIX
#define TYPE_URL_PREFIX
Definition: status_helper.cc:49
details
static grpc_slice details
Definition: test/core/fling/client.cc:46
value
const char * value
Definition: hpack_parser_table.cc:165
absl::Status
ABSL_NAMESPACE_BEGIN class ABSL_MUST_USE_RESULT Status
Definition: abseil-cpp/absl/status/internal/status_internal.h:36
grpc_core::slice_detail::BaseSlice::length
size_t length() const
Definition: src/core/lib/slice/slice.h:103
memory_diff.cur
def cur
Definition: memory_diff.py:83
absl::optional::value
constexpr const T & value() const &
Definition: abseil-cpp/absl/types/optional.h:475
absl::Now
ABSL_NAMESPACE_BEGIN Time Now()
Definition: abseil-cpp/absl/time/clock.cc:39
upb::Arena
Definition: upb.hpp:68
grpc_core::StatusStrProperty::kGrpcMessage
@ kGrpcMessage
grpc status message associated with this error
key
const char * key
Definition: hpack_parser_table.cc:164
grpc_core::StatusGetTime
absl::optional< absl::Time > StatusGetTime(const absl::Status &status, StatusTimeProperty key)
Gets the time property from the status.
Definition: status_helper.cc:235
upb_StringView
Definition: upb/upb/upb.h:72
absl::StatusCode
StatusCode
Definition: third_party/abseil-cpp/absl/status/status.h:92
grpc_core::StatusStrProperty::kKey
@ kKey
key associated with the error
upb.hpp
google_protobuf_Any_set_value
UPB_INLINE void google_protobuf_Any_set_value(google_protobuf_Any *msg, upb_StringView value)
Definition: any.upb.h:76
absl::Status
Definition: third_party/abseil-cpp/absl/status/status.h:424
grpc_core::Slice::FromExternalString
static Slice FromExternalString(absl::string_view str)
Definition: src/core/lib/slice/slice.h:382
percent_encoding.h
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
upb_StringView_FromDataAndSize
UPB_INLINE upb_StringView upb_StringView_FromDataAndSize(const char *data, size_t size)
Definition: upb/upb/upb.h:77
google_protobuf_Any_type_url
UPB_INLINE upb_StringView google_protobuf_Any_type_url(const google_protobuf_Any *msg)
Definition: any.upb.h:63
grpc_core::StatusIntProperty::kHttpStatus
@ kHttpStatus
HTTP status (i.e. 404)
type_url
string * type_url
Definition: bloaty/third_party/protobuf/conformance/conformance_cpp.cc:72
google_rpc_Status_message
UPB_INLINE upb_StringView google_rpc_Status_message(const google_rpc_Status *msg)
Definition: google/rpc/status.upb.h:71
absl::Status::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: third_party/abseil-cpp/absl/status/status.h:802
grpc_core::internal::StatusMoveFromHeapPtr
absl::Status StatusMoveFromHeapPtr(uintptr_t ptr)
Move the status from a heap ptr. (GetFrom & FreeHeap)
Definition: status_helper.cc:440
grpc_core::StatusIntProperty::kSize
@ kSize
context sensitive size associated with the error
absl::Status::GetPayload
absl::optional< absl::Cord > GetPayload(absl::string_view type_url) const
Definition: third_party/abseil-cpp/absl/status/status.cc:119
google_rpc_Status_serialize
UPB_INLINE char * google_rpc_Status_serialize(const google_rpc_Status *msg, upb_Arena *arena, size_t *len)
Definition: google/rpc/status.upb.h:55
grpc_core::StatusStrProperty
StatusStrProperty
This enum should have the same value of grpc_error_strs.
Definition: status_helper.h:83
internal
Definition: benchmark/test/output_test_helper.cc:20
absl::string_view::empty
constexpr bool empty() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:292
google_rpc_Status_new
UPB_INLINE google_rpc_Status * google_rpc_Status_new(upb_Arena *arena)
Definition: google/rpc/status.upb.h:33
grpc_core::StatusGetInt
absl::optional< intptr_t > StatusGetInt(const absl::Status &status, StatusIntProperty key)
Gets the int property from the status.
Definition: status_helper.cc:192
any.upb.h
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
kTypeUrlPrefix
static const char kTypeUrlPrefix[]
Definition: bloaty/third_party/protobuf/conformance/conformance_cpp.cc:60
grpc_core::StatusIntProperty::kOccurredDuringWrite
@ kOccurredDuringWrite
chttp2: did the error occur while a write was in progress
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
absl::Status::code
absl::StatusCode code() const
Definition: third_party/abseil-cpp/absl/status/status.cc:233
gen_server_registered_method_bad_client_test_body.payload
list payload
Definition: gen_server_registered_method_bad_client_test_body.py:40
grpc_core::StatusIntProperty
StatusIntProperty
This enum should have the same value of grpc_error_ints.
Definition: status_helper.h:45
absl::string_view::data
constexpr const_pointer data() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:336
to_string
static bool to_string(zval *from)
Definition: protobuf/php/ext/google/protobuf/convert.c:333
grpc_core::StatusIntProperty::kHttp2Error
@ kHttp2Error
http2 error code associated with the error (see the HTTP2 RFC)
children
std::map< std::string, Node * > children
Definition: bloaty/third_party/protobuf/src/google/protobuf/util/field_mask_util.cc:257
upb_Arena
Definition: upb_internal.h:36
google_rpc_Status_set_code
UPB_INLINE void google_rpc_Status_set_code(google_rpc_Status *msg, int32_t value)
Definition: google/rpc/status.upb.h:84
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
grpc_core::PercentEncodeSlice
Slice PercentEncodeSlice(Slice slice, PercentEncodingType type)
Definition: percent_encoding.cc:84
grpc_core::StatusIntProperty::kFd
@ kFd
File descriptor associated with this error.
grpc_core::StatusIntProperty::kIndex
@ kIndex
context sensitive index associated with the error
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google_protobuf_Any_value
UPB_INLINE upb_StringView google_protobuf_Any_value(const google_protobuf_Any *msg)
Definition: any.upb.h:69
grpc_core::StatusIntProperty::kErrorNo
@ kErrorNo
'errno' from the operating system
grpc_core::StatusStrProperty::kTargetAddress
@ kTargetAddress
peer that we were trying to communicate when this error occurred
port_platform.h


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:17