|
#define | GRPC_ERROR_NONE ((grpc_error_handle)NULL) |
| The following "special" errors can be propagated without allocating memory. More...
|
|
#define | GRPC_ERROR_RESERVED_1 ((grpc_error_handle)1) |
|
#define | GRPC_ERROR_OOM ((grpc_error_handle)2) |
|
#define | GRPC_ERROR_RESERVED_2 ((grpc_error_handle)3) |
|
#define | GRPC_ERROR_CANCELLED ((grpc_error_handle)4) |
|
#define | GRPC_ERROR_SPECIAL_MAX GRPC_ERROR_CANCELLED |
|
#define | GRPC_ERROR_REF(err) grpc_error_ref(err, __FILE__, __LINE__) |
|
#define | GRPC_ERROR_UNREF(err) grpc_error_unref(err, __FILE__, __LINE__) |
|
#define | GRPC_ERROR_CREATE_FROM_STATIC_STRING(desc) |
| Create an error (this is the preferred way of generating an error that is not due to a system call - for system calls, use GRPC_OS_ERROR or GRPC_WSA_ERROR as appropriate) referencing is an array of num_referencing elements indicating one or more errors that are believed to have contributed to this one err = grpc_error_create(x, y, z, r, nr) is equivalent to: err = grpc_error_create(x, y, z, NULL, 0); for (i=0; i<nr; i++) err = grpc_error_add_child(err, r[i]);. More...
|
|
#define | GRPC_ERROR_CREATE_FROM_COPIED_STRING(desc) |
|
#define | GRPC_ERROR_CREATE_FROM_STRING_VIEW(desc) |
|
#define | GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(desc, errs, count) |
|
#define | GRPC_ERROR_CREATE_REFERENCING_FROM_COPIED_STRING(desc, errs, count) |
|
#define | GRPC_ERROR_CREATE_FROM_VECTOR(desc, error_list) grpc_error_create_from_vector(__FILE__, __LINE__, desc, error_list) |
|
#define | GRPC_OS_ERROR(err, call_name) grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name)) |
| create an error associated with errno!=0 (an 'operating system' error) More...
|
|
#define | GRPC_WSA_ERROR(err, call_name) grpc_wsa_error(__FILE__, __LINE__, err, call_name) |
| windows only: create an error associated with WSAGetLastError()!=0 More...
|
|
#define | GRPC_LOG_IF_ERROR(what, error) (grpc_log_if_error((what), (error), __FILE__, __LINE__)) |
|
|
const char * | grpc_error_string (grpc_error_handle error) |
|
std::string | grpc_error_std_string (grpc_error_handle error) |
|
void | grpc_disable_error_creation () |
|
void | grpc_enable_error_creation () |
|
bool | grpc_error_is_special (grpc_error_handle err) |
|
grpc_error_handle | grpc_error_do_ref (grpc_error_handle err, const char *file, int line) |
|
void | grpc_error_do_unref (grpc_error_handle err, const char *file, int line) |
|
grpc_error_handle | grpc_error_ref (grpc_error_handle err, const char *file, int line) |
|
void | grpc_error_unref (grpc_error_handle err, const char *file, int line) |
|
grpc_error_handle | grpc_error_create (const char *file, int line, const grpc_slice &desc, grpc_error_handle *referencing, size_t num_referencing) |
| Create an error - but use GRPC_ERROR_CREATE instead. More...
|
|
grpc_error_handle | grpc_os_error (const char *file, int line, int err, const char *call_name) GRPC_MUST_USE_RESULT |
|
grpc_error_handle | grpc_assert_never_ok (grpc_error_handle error) |
|
grpc_error_handle | grpc_wsa_error (const char *file, int line, int err, const char *call_name) GRPC_MUST_USE_RESULT |
|
grpc_error_handle | grpc_error_set_int (grpc_error_handle src, grpc_error_ints which, intptr_t value) GRPC_MUST_USE_RESULT |
|
bool | grpc_error_get_int (grpc_error_handle error, grpc_error_ints which, intptr_t *p) |
| It is an error to pass nullptr as p . More...
|
|
grpc_error_handle | grpc_error_set_str (grpc_error_handle 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. More...
|
|
bool | grpc_error_get_str (grpc_error_handle error, grpc_error_strs which, grpc_slice *s) |
| Returns false if the specified string is not set. More...
|
|
grpc_error_handle | grpc_error_add_child (grpc_error_handle src, grpc_error_handle child) GRPC_MUST_USE_RESULT |
| Add a child error: an error that is believed to have contributed to this error occurring. More...
|
|
bool | grpc_log_error (const char *what, grpc_error_handle error, const char *file, int line) |
|
bool | grpc_log_if_error (const char *what, grpc_error_handle error, const char *file, int line) |
|
#define GRPC_ERROR_CREATE_FROM_STATIC_STRING |
( |
|
desc | ) |
|
Value:
NULL, 0)
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Create a slice pointing to constant memory.
Definition: slice.cc:108
Create an error (this is the preferred way of generating an error that is not due to a system call - for system calls, use GRPC_OS_ERROR or GRPC_WSA_ERROR as appropriate) referencing is an array of num_referencing elements indicating one or more errors that are believed to have contributed to this one err = grpc_error_create(x, y, z, r, nr) is equivalent to: err = grpc_error_create(x, y, z, NULL, 0); for (i=0; i<nr; i++) err = grpc_error_add_child(err, r[i]);.
Add a child error: an error that is believed to have contributed to this error occurring.
Allows root causing high level errors from lower level errors that contributed to them. The src error takes ownership of the child error.
Edge Conditions - 1) If either of src or child is GRPC_ERROR_NONE, returns a reference to the other argument. 2) If both src and child are GRPC_ERROR_NONE, returns GRPC_ERROR_NONE. 3) If src and child point to the same error, returns a single reference. (Note that, 2 references should have been received to the error in this case.)