19 #ifndef GRPC_CORE_LIB_IOMGR_ERROR_H 20 #define GRPC_CORE_LIB_IOMGR_ERROR_H 125 #define GRPC_ERROR_NONE ((grpc_error*)NULL) 126 #define GRPC_ERROR_RESERVED_1 ((grpc_error*)1) 127 #define GRPC_ERROR_OOM ((grpc_error*)2) 128 #define GRPC_ERROR_RESERVED_2 ((grpc_error*)3) 129 #define GRPC_ERROR_CANCELLED ((grpc_error*)4) 130 #define GRPC_ERROR_SPECIAL_MAX GRPC_ERROR_CANCELLED 146 size_t num_referencing);
155 #define GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc) \ 156 grpc_error_create(__FILE__, __LINE__, grpc_slice_from_static_string(desc), \ 158 #define GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc) \ 159 grpc_error_create(__FILE__, __LINE__, grpc_slice_from_copied_string(desc), \ 164 #define GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(desc, errs, count) \ 165 grpc_error_create(__FILE__, __LINE__, grpc_slice_from_static_string(desc), \ 167 #define GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(desc, errs, count) \ 168 grpc_error_create(__FILE__, __LINE__, grpc_slice_from_copied_string(desc), \ 171 #define GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list) \ 172 grpc_error_create_from_vector(__FILE__, __LINE__, desc, error_list) 185 #define GRPC_ERROR_REF(err) grpc_error_ref(err, __FILE__, __LINE__) 186 #define GRPC_ERROR_UNREF(err) grpc_error_unref(err, __FILE__, __LINE__) 198 #define GRPC_ERROR_REF(err) grpc_error_ref(err) 199 #define GRPC_ERROR_UNREF(err) grpc_error_unref(err) 205 static grpc_error* grpc_error_create_from_vector(
206 const char* file,
int line,
const char* desc,
209 if (error_list->
size() != 0) {
211 error_list->
data(), error_list->
size());
213 for (
size_t i = 0; i < error_list->
size(); i++) {
258 #define GRPC_OS_ERROR(err, call_name) \ 259 grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name)) 263 #define GRPC_WSA_ERROR(err, call_name) \ 264 grpc_wsa_error(__FILE__, __LINE__, err, call_name) 269 const char* file,
int line) {
274 #define GRPC_LOG_IF_ERROR(what, error) \ 275 (grpc_log_if_error((what), (error), __FILE__, __LINE__)) File descriptor associated with this error.
Definition: error.h:69
grpc_core::DebugOnlyTraceFlag grpc_trace_error_refcount
channel connectivity state associated with the error
Definition: error.h:77
top-level textual description of this error
Definition: error.h:85
bool grpc_error_get_str(grpc_error *error, grpc_error_strs which, grpc_slice *s)
Returns false if the specified string is not set.
key associated with the error
Definition: error.h:105
hex dump (or similar) with the data that generated this error
Definition: error.h:97
which data was queued for writing when the error occurred
Definition: error.h:103
grpc_error * grpc_error_set_int(grpc_error *src, grpc_error_ints which, intptr_t value) GRPC_MUST_USE_RESULT
source file in which this error occurred
Definition: error.h:87
Definition: inlined_vector.h:60
context sensitive index associated with the error
Definition: error.h:57
WSAGetLastError() reported when this error occurred.
Definition: error.h:67
syscall that generated this error
Definition: error.h:91
grpc_security_status associated with the error
Definition: error.h:65
Must always be last.
Definition: error.h:110
void grpc_enable_error_creation()
bool grpc_log_if_error(const char *what, grpc_error *error, const char *file, int line)
Definition: error.h:268
T * data()
Definition: inlined_vector.h:93
Must always be last.
Definition: error.h:118
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1]. ...
Definition: slice.h:60
Definition: error_internal.h:39
grpc_error_times
Definition: error.h:113
grpc status message associated with this error
Definition: error.h:95
const char * grpc_error_string(grpc_error *error)
tsi error string associated with this error
Definition: error.h:99
filename that we were trying to read/write when this error occurred
Definition: error.h:101
grpc status code representing this error
Definition: error.h:52
void grpc_error_do_unref(grpc_error *err, const char *file, int line)
'errno' from the operating system
Definition: error.h:45
LINE from the call site creating the error
Definition: error.h:47
bool grpc_log_error(const char *what, grpc_error *error, const char *file, int line)
value associated with the error
Definition: error.h:107
grpc_error_ints
Definition: error.h:43
grpc_error * grpc_assert_never_ok(grpc_error *error)
Definition: error.h:252
grpc_error * grpc_os_error(const char *file, int line, int err, const char *call_name) GRPC_MUST_USE_RESULT
grpc_error * grpc_error_ref(grpc_error *err, const char *file, int line)
Definition: error.h:177
bool grpc_error_is_special(struct grpc_error *err)
Definition: error.h:132
grpc_error * grpc_error_add_child(grpc_error *src, grpc_error *child) GRPC_MUST_USE_RESULT
Add a child error: an error that is believed to have contributed to this error occurring.
#define GPR_ASSERT(x)
abort() the process if x is zero, having written a line to the log.
Definition: log.h:94
grpc_error_strs
Definition: error.h:83
size_t size() const
Definition: inlined_vector.h:165
grpc_error * grpc_error_do_ref(grpc_error *err, const char *file, int line)
peer that we were trying to communicate when this error occurred
Definition: error.h:93
HTTP status (i.e. 404)
Definition: error.h:71
context sensitive size associated with the error
Definition: error.h:59
chttp2: did the error occur while a write was in progress
Definition: error.h:75
#define GRPC_ERROR_NONE
The following "special" errors can be propagated without allocating memory.
Definition: error.h:125
offset into some binary blob (usually represented by GRPC_ERROR_STR_RAW_BYTES) where the error occurr...
Definition: error.h:55
void grpc_disable_error_creation()
grpc_error * grpc_wsa_error(const char *file, int line, int err, const char *call_name) GRPC_MUST_USE_RESULT
void clear()
Definition: inlined_vector.h:170
#define GRPC_ERROR_UNREF(err)
Definition: error.h:186
context sensitive limit associated with the error
Definition: error.h:73
#define GRPC_ERROR_SPECIAL_MAX
Definition: error.h:130
stream identifier: for errors that are associated with an individual wire stream
Definition: error.h:50
timestamp of error creation
Definition: error.h:115
operating system description of this error
Definition: error.h:89
grpc_error * grpc_error_create(const char *file, int line, const grpc_slice &desc, grpc_error **referencing, size_t num_referencing)
Create an error - but use GRPC_ERROR_CREATE instead.
http2 error code associated with the error (see the HTTP2 RFC)
Definition: error.h:61
TSI status code associated with the error.
Definition: error.h:63
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Create a slice pointing to constant memory.
void grpc_error_unref(grpc_error *err, const char *file, int line)
Definition: error.h:181
bool grpc_error_get_int(grpc_error *error, grpc_error_ints which, intptr_t *p)
It is an error to pass nullptr as p.
Must always be last.
Definition: error.h:80
grpc_error * grpc_error_set_str(grpc_error *src, grpc_error_strs which, const grpc_slice &str) GRPC_MUST_USE_RESULT
This call takes ownership of the slice; the error is responsible for eventually unref-ing it...