diff options
author | 2017-03-27 15:47:58 -0700 | |
---|---|---|
committer | 2017-03-27 15:47:58 -0700 | |
commit | 978c34f6eae3a66ee91113928d9d057aefcc009d (patch) | |
tree | 069b7b00ae6314548187f5e52a70c7d07ebf3e7a /src/core/lib/transport/error_utils.c | |
parent | e5ddd4b906b99781709b5f77b9c2b277df9d51c4 (diff) | |
parent | 6f1e443a519cd28d97be78c5ca2ca72a45f6b598 (diff) |
Merge branch 'master' into stream_corked_pr
Diffstat (limited to 'src/core/lib/transport/error_utils.c')
-rw-r--r-- | src/core/lib/transport/error_utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/lib/transport/error_utils.c b/src/core/lib/transport/error_utils.c index ef55e561fb..4e70f8749d 100644 --- a/src/core/lib/transport/error_utils.c +++ b/src/core/lib/transport/error_utils.c @@ -55,7 +55,7 @@ static grpc_error *recursively_find_error_with_field(grpc_error *error, } void grpc_error_get_status(grpc_error *error, gpr_timespec deadline, - grpc_status_code *code, const char **msg, + grpc_status_code *code, grpc_slice *slice, grpc_http2_error_code *http_error) { // Start with the parent error and recurse through the tree of children // until we find the first one that has a status code. @@ -97,11 +97,11 @@ void grpc_error_get_status(grpc_error *error, gpr_timespec deadline, // If the error has a status message, use it. Otherwise, fall back to // the error description. - if (msg != NULL) { - *msg = grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE); - if (*msg == NULL && error != GRPC_ERROR_NONE) { - *msg = grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION); - if (*msg == NULL) *msg = "unknown error"; // Just in case. + if (slice != NULL) { + if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_GRPC_MESSAGE, slice)) { + if (!grpc_error_get_str(found_error, GRPC_ERROR_STR_DESCRIPTION, slice)) { + *slice = grpc_slice_from_static_string("unknown error"); + } } } |