Return errors in lieu of aborting

pull/14868/head
David Garcia Quintas 7 years ago
parent d3ace6cf29
commit 64fdf0af94
  1. 9
      src/core/ext/filters/http/client_authority_filter.cc

@ -91,18 +91,15 @@ grpc_error* init_channel_elem(grpc_channel_element* elem,
const grpc_arg* default_authority_arg = const grpc_arg* default_authority_arg =
grpc_channel_args_find(args->channel_args, GRPC_ARG_DEFAULT_AUTHORITY); grpc_channel_args_find(args->channel_args, GRPC_ARG_DEFAULT_AUTHORITY);
if (default_authority_arg == nullptr) { if (default_authority_arg == nullptr) {
gpr_log( return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
GPR_ERROR,
"GRPC_ARG_DEFAULT_AUTHORITY channel arg. not found. Note that direct " "GRPC_ARG_DEFAULT_AUTHORITY channel arg. not found. Note that direct "
"channels must explicity specify a value for this argument."); "channels must explicity specify a value for this argument.");
abort();
} }
const char* default_authority_str = const char* default_authority_str =
grpc_channel_arg_get_string(default_authority_arg); grpc_channel_arg_get_string(default_authority_arg);
if (default_authority_str == nullptr) { if (default_authority_str == nullptr) {
gpr_log(GPR_ERROR, return GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"GRPC_ARG_DEFAULT_AUTHORITY channel arg. must be a string."); "GRPC_ARG_DEFAULT_AUTHORITY channel arg. must be a string");
abort();
} }
chand->default_authority = chand->default_authority =
grpc_slice_from_copied_string(default_authority_str); grpc_slice_from_copied_string(default_authority_str);

Loading…
Cancel
Save