#include <grpc/support/port_platform.h>
#include <inttypes.h>
#include <stdbool.h>
#include "absl/status/status.h"
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gpr/spinlock.h"
#include "src/core/lib/gprpp/status_helper.h"
#include "src/core/lib/slice/slice_internal.h"
Go to the source code of this file.
Classes | |
class | AtomicError |
Typedefs | |
typedef struct grpc_error | grpc_error |
typedef grpc_error * | grpc_error_handle |
#define GRPC_ERROR_CANCELLED ((grpc_error_handle)4) |
#define GRPC_ERROR_CREATE_FROM_COPIED_STRING | ( | desc | ) |
#define GRPC_ERROR_CREATE_FROM_CPP_STRING | ( | desc | ) |
#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]);
#define GRPC_ERROR_CREATE_FROM_STRING_VIEW | ( | desc | ) |
#define GRPC_ERROR_CREATE_FROM_VECTOR | ( | desc, | |
error_list | |||
) |
#define GRPC_ERROR_CREATE_FROM_VECTOR_AND_CPP_STRING | ( | desc, | |
error_list | |||
) |
#define GRPC_ERROR_IS_NONE | ( | err | ) | ((err) == GRPC_ERROR_NONE) |
#define GRPC_ERROR_NONE ((grpc_error_handle)NULL) |
#define GRPC_ERROR_OOM ((grpc_error_handle)2) |
#define GRPC_ERROR_REF | ( | err | ) | grpc_error_ref(err, __FILE__, __LINE__) |
#define GRPC_ERROR_RESERVED_1 ((grpc_error_handle)1) |
#define GRPC_ERROR_RESERVED_2 ((grpc_error_handle)3) |
#define GRPC_ERROR_SPECIAL_MAX GRPC_ERROR_CANCELLED |
#define GRPC_ERROR_UNREF | ( | err | ) | grpc_error_unref(err, __FILE__, __LINE__) |
#define GRPC_LOG_IF_ERROR | ( | what, | |
error | |||
) | (grpc_log_if_error((what), (error), __FILE__, __LINE__)) |
#define GRPC_OS_ERROR | ( | err, | |
call_name | |||
) | grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name)) |
#define GRPC_WSA_ERROR | ( | err, | |
call_name | |||
) | grpc_wsa_error(__FILE__, __LINE__, err, call_name) |
typedef struct grpc_error grpc_error |
Opaque representation of an error. See https://github.com/grpc/grpc/blob/master/doc/core/grpc-error.md for a full write up of this object.
typedef grpc_error* grpc_error_handle |
enum grpc_error_ints |
enum grpc_error_strs |
enum grpc_error_times |
|
inline |
grpc_error_handle grpc_error_add_child | ( | grpc_error_handle | src, |
grpc_error_handle | child | ||
) |
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.)
grpc_error_handle grpc_error_create | ( | const char * | file, |
int | line, | ||
const grpc_slice & | desc, | ||
grpc_error_handle * | referencing, | ||
size_t | num_referencing | ||
) |
|
static |
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 | ||
) |
bool grpc_error_get_int | ( | grpc_error_handle | error, |
grpc_error_ints | which, | ||
intptr_t * | p | ||
) |
bool grpc_error_get_str | ( | grpc_error_handle | error, |
grpc_error_strs | which, | ||
std::string * | str | ||
) |
|
inline |
|
inline |
grpc_error_handle grpc_error_set_int | ( | grpc_error_handle | src, |
grpc_error_ints | which, | ||
intptr_t | value | ||
) |
grpc_error_handle grpc_error_set_str | ( | grpc_error_handle | src, |
grpc_error_strs | which, | ||
absl::string_view | str | ||
) |
std::string grpc_error_std_string | ( | grpc_error_handle | error | ) |
|
inline |
bool grpc_log_error | ( | const char * | what, |
grpc_error_handle | error, | ||
const char * | file, | ||
int | line | ||
) |
|
inline |
grpc_error_handle grpc_os_error | ( | const char * | file, |
int | line, | ||
int | err, | ||
const char * | call_name | ||
) |
grpc_error_handle grpc_wsa_error | ( | const char * | file, |
int | line, | ||
int | err, | ||
const char * | call_name | ||
) |