Skip to content

Commit

Permalink
error name update
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 committed Dec 8, 2023
1 parent 76c6a08 commit 6119029
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/aws/s3/s3.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum aws_s3_errors {
AWS_ERROR_S3_EXCEEDS_MEMORY_LIMIT,
AWS_ERROR_S3_INVALID_MEMORY_LIMIT_CONFIG,
AWS_ERROR_S3EXPRESS_CREATE_SESSION_FAILED,
AWS_ERROR_S3_INTERNAL_PART_TOO_LARGE_RETRYING_WITH_RANGE,
AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE,

AWS_ERROR_S3_END_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_S3_PACKAGE_ID)
};
Expand Down
2 changes: 1 addition & 1 deletion source/s3.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static struct aws_error_info s_errors[] = {
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_INVALID_MEMORY_LIMIT_CONFIG, "Specified memory configuration is invalid for the system. "
"Memory limit should be at least 1GiB. Part size and max part size should be smaller than memory limit."),
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3EXPRESS_CREATE_SESSION_FAILED, "CreateSession call failed when signing with S3 Express."),
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_INTERNAL_PART_TOO_LARGE_RETRYING_WITH_RANGE, "Request body length is not greator than part_size."),
AWS_DEFINE_ERROR_INFO_S3(AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE, "part_size mismatch, possibly due to bad size_hint. Retrying with Range instead of partGet."),

};
/* clang-format on */
Expand Down
2 changes: 1 addition & 1 deletion source/s3_auto_ranged_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ static void s_s3_auto_ranged_get_request_finished(

bool found_object_size = false;
bool request_failed = error_code != AWS_ERROR_SUCCESS;
bool first_part_size_mismatch = (error_code == AWS_ERROR_S3_INTERNAL_PART_TOO_LARGE_RETRYING_WITH_RANGE);
bool first_part_size_mismatch = (error_code == AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE);

if (request->discovers_object_size) {

Expand Down
6 changes: 3 additions & 3 deletions source/s3_meta_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ static int s_s3_meta_request_headers_block_done(
request->allocator, request->send_data.response_headers, &content_length)) {

if (content_length > meta_request->part_size) {
return aws_raise_error(AWS_ERROR_S3_INTERNAL_PART_TOO_LARGE_RETRYING_WITH_RANGE);
return aws_raise_error(AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE);
}
}
}
Expand Down Expand Up @@ -1544,10 +1544,10 @@ void aws_s3_meta_request_send_request_finish_default(
/* If the request failed due to an invalid (ie: unrecoverable) response status, or the meta request already
* has a result, then make sure that this request isn't retried. */
if (error_code == AWS_ERROR_S3_INVALID_RESPONSE_STATUS ||
error_code == AWS_ERROR_S3_INTERNAL_PART_TOO_LARGE_RETRYING_WITH_RANGE ||
error_code == AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE ||
error_code == AWS_ERROR_S3_NON_RECOVERABLE_ASYNC_ERROR || meta_request_finishing) {
finish_code = AWS_S3_CONNECTION_FINISH_CODE_FAILED;
if (error_code == AWS_ERROR_S3_INTERNAL_PART_TOO_LARGE_RETRYING_WITH_RANGE) {
if (error_code == AWS_ERROR_S3_INTERNAL_PART_SIZE_MISMATCH_RETRYING_WITH_RANGE) {
/* Log at info level instead of error as it's expected and not a fatal error */
AWS_LOGF_INFO(
AWS_LS_S3_META_REQUEST,
Expand Down

0 comments on commit 6119029

Please sign in to comment.