Skip to content

Commit cc7425e

Browse files
authored
Fix a bunch of places we forget to aws_raise_error() (#1089)
1 parent 7f55a9c commit cc7425e

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'main'
77

88
env:
9-
BUILDER_VERSION: v0.9.49
9+
BUILDER_VERSION: v0.9.55
1010
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1111
BUILDER_SOURCE: releases
1212
PACKAGE_NAME: aws-c-common

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55

66
env:
7-
BUILDER_VERSION: v0.9.37
7+
BUILDER_VERSION: v0.9.55
88
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
99
BUILDER_SOURCE: releases
1010
PACKAGE_NAME: aws-c-common

include/aws/common/json.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ int aws_byte_buf_append_json_string(const struct aws_json_value *value, struct a
400400
* @param value The aws_json_value to format.
401401
* @param output The destination for the JSON string
402402
* @return AWS_OP_SUCCESS if the JSON string was allocated to output without any errors
403-
* Will return AWS_ERROR_INVALID_ARGUMENT if the value passed is not an aws_json_value or if there
403+
* Will return AWS_OP_ERR if the value passed is not an aws_json_value or if there
404404
* aws an error appending the JSON into the byte buffer.
405405
*/
406406
AWS_COMMON_API

source/json.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ int aws_byte_buf_append_json_string(const struct aws_json_value *value, struct a
397397

398398
char *tmp = cJSON_PrintUnformatted(cjson);
399399
if (tmp == NULL) {
400-
return AWS_OP_ERR;
400+
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
401401
}
402402

403403
// Append the text to the byte buffer
@@ -415,7 +415,7 @@ int aws_byte_buf_append_json_string_formatted(const struct aws_json_value *value
415415

416416
char *tmp = cJSON_Print(cjson);
417417
if (tmp == NULL) {
418-
return AWS_OP_ERR;
418+
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
419419
}
420420

421421
// Append the text to the byte buffer

source/log_formatter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ static int s_default_aws_log_formatter_format(
205205
struct aws_default_log_formatter_impl *impl = formatter->impl;
206206

207207
if (formatted_output == NULL) {
208-
return AWS_OP_ERR;
208+
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
209209
}
210210

211211
/*

source/logging.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,11 @@ int aws_thread_id_t_to_string(aws_thread_id_t thread_id, char *buffer, size_t bu
337337
unsigned char c = bytes[i - 1];
338338
int written = snprintf(buffer + current_index, bufsz - current_index, "%02x", c);
339339
if (written < 0) {
340-
return AWS_OP_ERR;
340+
return aws_raise_error(AWS_ERROR_INVALID_ARGUMENT);
341341
}
342342
current_index += written;
343343
if (bufsz <= current_index) {
344-
return AWS_OP_ERR;
344+
return aws_raise_error(AWS_ERROR_SHORT_BUFFER);
345345
}
346346
}
347347
return AWS_OP_SUCCESS;

tests/encoding_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ static int s_utf8_validation_callback_always_fails(const uint32_t codepoint, voi
12981298
static int s_utf8_validation_callback_always_passes(const uint32_t codepoint, void *user_data) {
12991299
(void)codepoint;
13001300
(void)user_data;
1301-
return AWS_ERROR_SUCCESS;
1301+
return AWS_OP_SUCCESS;
13021302
}
13031303

13041304
static struct utf8_example s_valid_utf8_examples_for_callback[] = {

0 commit comments

Comments
 (0)