diff options
author | Noah Eisen <ncteisen@google.com> | 2017-11-13 16:44:02 -0800 |
---|---|---|
committer | Noah Eisen <ncteisen@google.com> | 2017-11-13 16:44:02 -0800 |
commit | 68bb1bf7480e87005220003985da19ea0a0929d0 (patch) | |
tree | c434576b07f94f427925dd7f7dfba4dbdeecee31 /src/core/lib/iomgr/error.h | |
parent | 6bf73e8cf6d9d2ede844ab628a0b88000ffc9afa (diff) | |
parent | b0bad8f3864dc9c8745736fe68efe513b2b84932 (diff) |
Merge branch 'master' of https://github.com/grpc/grpc into tracing++
Diffstat (limited to 'src/core/lib/iomgr/error.h')
-rw-r--r-- | src/core/lib/iomgr/error.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h index c81429ef8a..d10bf0b359 100644 --- a/src/core/lib/iomgr/error.h +++ b/src/core/lib/iomgr/error.h @@ -24,6 +24,7 @@ #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" @@ -182,9 +183,15 @@ grpc_error* grpc_error_add_child(grpc_error* src, grpc_error* child) GRPC_MUST_USE_RESULT; grpc_error* grpc_os_error(const char* file, int line, int err, const char* call_name) GRPC_MUST_USE_RESULT; + +inline grpc_error* grpc_assert_never_ok(grpc_error* error) { + GPR_ASSERT(error != GRPC_ERROR_NONE); + return error; +} + /// create an error associated with errno!=0 (an 'operating system' error) #define GRPC_OS_ERROR(err, call_name) \ - grpc_os_error(__FILE__, __LINE__, err, call_name) + grpc_assert_never_ok(grpc_os_error(__FILE__, __LINE__, err, call_name)) grpc_error* grpc_wsa_error(const char* file, int line, int err, const char* call_name) GRPC_MUST_USE_RESULT; /// windows only: create an error associated with WSAGetLastError()!=0 |