aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-11-17 16:50:12 -0800
committerGravatar ncteisen <ncteisen@gmail.com>2017-11-17 16:50:47 -0800
commitf852c060384027ae1c82b1ea5d8dae62c9c5ea3c (patch)
tree2620a33c5535cf1ac44216a00a7cbd9f67f80785 /src
parent9e2be4998e453ef66a595b230519a006ca257529 (diff)
Fix TSAN attempt
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/transport/error_utils.cc9
-rw-r--r--src/core/lib/transport/error_utils.h6
2 files changed, 9 insertions, 6 deletions
diff --git a/src/core/lib/transport/error_utils.cc b/src/core/lib/transport/error_utils.cc
index 723663a6d7..acac1330b5 100644
--- a/src/core/lib/transport/error_utils.cc
+++ b/src/core/lib/transport/error_utils.cc
@@ -43,7 +43,7 @@ static grpc_error* recursively_find_error_with_field(grpc_error* error,
void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error,
grpc_millis deadline, grpc_status_code* code,
grpc_slice* slice, grpc_http2_error_code* http_error,
- const char** full_error_details) {
+ const char** error_string) {
// Start with the parent error and recurse through the tree of children
// until we find the first one that has a status code.
grpc_error* found_error =
@@ -70,8 +70,11 @@ void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error,
}
if (code != nullptr) *code = status;
- if (full_error_details != NULL && status != GRPC_STATUS_OK) {
- *full_error_details = gpr_strdup(grpc_error_string(error));
+ if (error_string != NULL && status != GRPC_STATUS_OK) {
+ const char* str = grpc_error_string(error);
+ if (str != nullptr) {
+ *error_string = gpr_strdup(str);
+ }
}
if (http_error != nullptr) {
diff --git a/src/core/lib/transport/error_utils.h b/src/core/lib/transport/error_utils.h
index d47c4f2a3b..6f21f484e5 100644
--- a/src/core/lib/transport/error_utils.h
+++ b/src/core/lib/transport/error_utils.h
@@ -30,15 +30,15 @@ extern "C" {
/// 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.
-/// All attributes are pulled from the same child error. full_error_details will
+/// All attributes are pulled from the same child error. error_string will
/// be populated with the entire error string. If any of the attributes (code,
-/// msg, http_status, full_error_details) are unneeded, they can be passed as
+/// msg, http_status, error_string) are unneeded, they can be passed as
/// NULL.
void grpc_error_get_status(grpc_exec_ctx* exec_ctx, grpc_error* error,
grpc_millis deadline, grpc_status_code* code,
grpc_slice* slice,
grpc_http2_error_code* http_status,
- const char** full_error_details);
+ const char** error_string);
/// A utility function to check whether there is a clear status code that
/// doesn't need to be guessed in \a error. This means that \a error or some