aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/error.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-09-29 10:27:44 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-09-29 10:27:44 -0700
commitca3451de7afdd8c9863872a6627a992ce6abfda4 (patch)
tree03fb869d3a22da0ba683864feb61c82a2adbfd76 /src/core/lib/iomgr/error.h
parent7f0bf534df61f8e0320ac3a69f6c0e75e58d3ccd (diff)
parentd914591e95ac38c6f178969a46b02e507ed7641a (diff)
Merge github.com:grpc/grpc into direct-calls
Diffstat (limited to 'src/core/lib/iomgr/error.h')
-rw-r--r--src/core/lib/iomgr/error.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/error.h b/src/core/lib/iomgr/error.h
index 2ab3ef9f40..2d715500d1 100644
--- a/src/core/lib/iomgr/error.h
+++ b/src/core/lib/iomgr/error.h
@@ -37,6 +37,7 @@
#include <stdbool.h>
#include <stdint.h>
+#include <grpc/status.h>
#include <grpc/support/time.h>
/// Opaque representation of an error.
@@ -179,6 +180,13 @@ grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which,
/// Returns NULL if the specified string is not set.
/// Caller does NOT own return value.
const char *grpc_error_get_str(grpc_error *error, grpc_error_strs which);
+
+/// A utility function to get the status code and message to be returned
+/// to the application. If not set in the top-level message, looks
+/// through child errors until it finds the first one with these attributes.
+void grpc_error_get_status(grpc_error *error, grpc_status_code *code,
+ const char **msg);
+
/// 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.