Skip to content

Commit 5151603

Browse files
authored
MONGOCRYPT-904 fix KMS error messages (#1162)
MONGOCRYPT-904 remove `bson_error_t` from error message
1 parent 5c58912 commit 5151603

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

src/mongocrypt-kms-ctx.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,7 @@ static bool _ctx_done_aws(mongocrypt_kms_ctx_t *kms, const char *json_field) {
578578
*/
579579
bson_destroy(&body_bson);
580580
if (body_len > (size_t)SSIZE_MAX) {
581-
CLIENT_ERR("Error parsing JSON in KMS response '%s'. "
582-
"Response body exceeds maximum supported length",
583-
bson_error.message);
581+
CLIENT_ERR("Error parsing JSON in KMS response. Response body exceeds maximum supported length");
584582
bson_init(&body_bson);
585583
goto fail;
586584
}
@@ -671,9 +669,7 @@ static bool _ctx_done_oauth(mongocrypt_kms_ctx_t *kms) {
671669
}
672670

673671
if (body_len > (size_t)SSIZE_MAX) {
674-
CLIENT_ERR("Error parsing JSON in KMS response '%s'. "
675-
"Response body exceeds maximum supported length",
676-
bson_error.message);
672+
CLIENT_ERR("Error parsing JSON in KMS response. Response body exceeds maximum supported length");
677673
goto fail;
678674
}
679675
bson_body = bson_new_from_json((const uint8_t *)body, (ssize_t)body_len, &bson_error);
@@ -763,9 +759,7 @@ static bool _ctx_done_azure_wrapkey_unwrapkey(mongocrypt_kms_ctx_t *kms) {
763759
}
764760

765761
if (body_len > (size_t)SSIZE_MAX) {
766-
CLIENT_ERR("Error parsing JSON in KMS response '%s'. "
767-
"Response body exceeds maximum supported length",
768-
bson_error.message);
762+
CLIENT_ERR("Error parsing JSON in KMS response. Response body exceeds maximum supported length");
769763
goto fail;
770764
}
771765
bson_body = bson_new_from_json((const uint8_t *)body, (ssize_t)body_len, &bson_error);
@@ -875,9 +869,7 @@ static bool _ctx_done_gcp(mongocrypt_kms_ctx_t *kms, const char *json_field) {
875869
*/
876870
bson_destroy(&body_bson);
877871
if (body_len > (size_t)SSIZE_MAX) {
878-
CLIENT_ERR("Error parsing JSON in KMS response '%s'. "
879-
"Response body exceeds maximum supported length",
880-
bson_error.message);
872+
CLIENT_ERR("Error parsing JSON in KMS response. Response body exceeds maximum supported length");
881873
bson_init(&body_bson);
882874
goto fail;
883875
}

0 commit comments

Comments
 (0)