Skip to content
Snippets Groups Projects
Commit 9f97cca3 authored by Mark D. Roth's avatar Mark D. Roth
Browse files

Fix error handling in grpc_call_create().

parent 0badbe8b
No related branches found
No related tags found
No related merge requests found
...@@ -266,8 +266,18 @@ grpc_call *grpc_call_create( ...@@ -266,8 +266,18 @@ grpc_call *grpc_call_create(
destroy_call, call, call->context, destroy_call, call, call->context,
server_transport_data, server_transport_data,
CALL_STACK_FROM_CALL(call)); CALL_STACK_FROM_CALL(call));
// FIXME: handle error (probably requires changing this function's API) if (error != GRPC_ERROR_NONE) {
GPR_ASSERT(error == GRPC_ERROR_NONE); intptr_t status;
if (!grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, &status))
status = GRPC_STATUS_UNKNOWN;
const char* error_string = grpc_error_string(error);
received_status* status_struct = &call->status[STATUS_FROM_CORE];
status_struct->is_set = true;
status_struct->code = status;
status_struct->details = grpc_mdstr_from_string(error_string);
grpc_error_free_string(error_string);
grpc_error_unref(error);
}
if (cq != NULL) { if (cq != NULL) {
GPR_ASSERT( GPR_ASSERT(
pollset_set_alternative == NULL && pollset_set_alternative == NULL &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment