Skip to content

Commit

Permalink
Merge pull request grpc#5935 from ctiller/status_codes
Browse files Browse the repository at this point in the history
Fix some status codes to match spec
  • Loading branch information
jboeuf committed Mar 28, 2016
2 parents e5cc05b + 8ae3b1f commit 9a0f14b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/lib/security/client_auth_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static void send_security_metadata(grpc_exec_ctx *exec_ctx,
calld->creds = grpc_composite_call_credentials_create(channel_call_creds,
ctx->creds, NULL);
if (calld->creds == NULL) {
bubble_up_error(exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT,
bubble_up_error(exec_ctx, elem, GRPC_STATUS_INTERNAL,
"Incompatible credentials set on channel and call.");
return;
}
Expand Down Expand Up @@ -201,7 +201,7 @@ static void on_host_checked(grpc_exec_ctx *exec_ctx, void *user_data,
char *error_msg;
gpr_asprintf(&error_msg, "Invalid host %s set in :authority metadata.",
grpc_mdstr_as_c_string(calld->host));
bubble_up_error(exec_ctx, elem, GRPC_STATUS_INVALID_ARGUMENT, error_msg);
bubble_up_error(exec_ctx, elem, GRPC_STATUS_INTERNAL, error_msg);
gpr_free(error_msg);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/core/lib/surface/secure_channel_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ grpc_channel *grpc_secure_channel_create(grpc_channel_credentials *creds,
gpr_log(GPR_ERROR, "Cannot set security context in channel args.");
grpc_exec_ctx_finish(&exec_ctx);
return grpc_lame_client_channel_create(
target, GRPC_STATUS_INVALID_ARGUMENT,
target, GRPC_STATUS_INTERNAL,
"Security connector exists in channel args.");
}

Expand All @@ -276,8 +276,7 @@ grpc_channel *grpc_secure_channel_create(grpc_channel_credentials *creds,
GRPC_SECURITY_OK) {
grpc_exec_ctx_finish(&exec_ctx);
return grpc_lame_client_channel_create(
target, GRPC_STATUS_INVALID_ARGUMENT,
"Failed to create security connector.");
target, GRPC_STATUS_INTERNAL, "Failed to create security connector.");
}

connector_arg = grpc_security_connector_to_arg(&security_connector->base);
Expand Down
2 changes: 1 addition & 1 deletion test/core/end2end/tests/bad_hostname.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void simple_request_body(grpc_end2end_test_fixture f) {
cq_expect_completion(cqv, tag(1), 1);
cq_verify(cqv);

GPR_ASSERT(status == GRPC_STATUS_INVALID_ARGUMENT);
GPR_ASSERT(status == GRPC_STATUS_INTERNAL);

gpr_free(details);
grpc_metadata_array_destroy(&initial_metadata_recv);
Expand Down

0 comments on commit 9a0f14b

Please sign in to comment.