Skip to content

Commit

Permalink
Fix a bunch of places we forget to aws_raise_error() (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Feb 13, 2024
1 parent 8e5e461 commit 0d2aa00
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'main'

env:
BUILDER_VERSION: v0.9.43
BUILDER_VERSION: v0.9.55
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-c-auth
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

env:
BUILDER_VERSION: v0.9.29
BUILDER_VERSION: v0.9.55
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
BUILDER_SOURCE: releases
PACKAGE_NAME: aws-c-auth
Expand Down
2 changes: 1 addition & 1 deletion source/aws_imds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ static int s_on_incoming_body_fn(struct aws_http_stream *stream, const struct aw
AWS_LOGF_ERROR(
AWS_LS_IMDS_CLIENT, "(id=%p) IMDS client query response exceeded maximum allowed length", (void *)client);

return AWS_OP_ERR;
return aws_raise_error(AWS_AUTH_IMDS_CLIENT_SOURCE_FAILURE);
}

if (aws_byte_buf_append_dynamic(&imds_user_data->current_result, data)) {
Expand Down
2 changes: 1 addition & 1 deletion source/aws_signing.c
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ int aws_signing_build_canonical_request(struct aws_signing_state_aws *state) {
return s_apply_existing_canonical_request(state);

default:
return AWS_OP_ERR;
return aws_raise_error(AWS_AUTH_SIGNING_UNSUPPORTED_SIGNATURE_TYPE);
}
}

Expand Down
4 changes: 2 additions & 2 deletions source/signable_chunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static int s_aws_signable_chunk_get_property(
if (aws_string_eq(name, g_aws_previous_signature_property_name)) {
*out_value = aws_byte_cursor_from_string(impl->previous_signature);
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
}

return AWS_OP_SUCCESS;
Expand All @@ -44,7 +44,7 @@ static int s_aws_signable_chunk_get_property_list(
(void)name;
(void)out_list;

return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
}

static int s_aws_signable_chunk_get_payload_stream(
Expand Down
4 changes: 2 additions & 2 deletions source/signable_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int s_aws_signable_http_request_get_property(
} else if (aws_string_eq(name, g_aws_http_method_property_name)) {
aws_http_message_get_request_method(impl->request, out_value);
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
}

return AWS_OP_SUCCESS;
Expand All @@ -50,7 +50,7 @@ static int s_aws_signable_http_request_get_property_list(
if (aws_string_eq(name, g_aws_http_headers_property_list_name)) {
*out_list = &impl->headers;
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
}

return AWS_OP_SUCCESS;
Expand Down
4 changes: 2 additions & 2 deletions source/signable_trailer.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static int s_aws_signable_trailing_headers_get_property(
if (aws_string_eq(name, g_aws_previous_signature_property_name)) {
*out_value = aws_byte_cursor_from_string(impl->previous_signature);
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
}
return AWS_OP_SUCCESS;
}
Expand All @@ -48,7 +48,7 @@ static int s_aws_signable_trailing_headers_get_property_list(
if (aws_string_eq(name, g_aws_http_headers_property_list_name)) {
*out_list = &impl->headers;
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
}

return AWS_OP_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion source/sigv4_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int aws_apply_signing_result_to_http_request(
}

if (source_header.name == NULL || source_header.value == NULL) {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
}

struct aws_http_header dest_header = {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_signable.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int s_aws_signable_test_get_property(
} else if (aws_string_eq(name, g_aws_http_method_property_name)) {
*out_value = impl->method;
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
}

return AWS_OP_SUCCESS;
Expand All @@ -47,7 +47,7 @@ static int s_aws_signable_test_get_property_list(
if (aws_string_eq(name, g_aws_http_headers_property_list_name)) {
*out_list = &impl->headers;
} else {
return AWS_OP_ERR;
return aws_raise_error(AWS_ERROR_UNSUPPORTED_OPERATION);
}

return AWS_OP_SUCCESS;
Expand Down

0 comments on commit 0d2aa00

Please sign in to comment.