summaryrefslogtreecommitdiffstats
path: root/core/crypto
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-10-11 16:17:49 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-10-30 15:55:51 +0100
commit38f9769bc6d560373df961880f99aaaafaae00d9 (patch)
tree4bb21478d3cefde5c03c864bbaf65a31c1f7576a /core/crypto
parent8004c7524fb9f43425c4d6f614410a76678e0f7c (diff)
downloadredot-engine-38f9769bc6d560373df961880f99aaaafaae00d9.tar.gz
[Core] Improve error messages with `vformat`
Diffstat (limited to 'core/crypto')
-rw-r--r--core/crypto/crypto.cpp2
-rw-r--r--core/crypto/crypto_core.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp
index 62bacadf91..30003e4ea8 100644
--- a/core/crypto/crypto.cpp
+++ b/core/crypto/crypto.cpp
@@ -240,7 +240,7 @@ Error ResourceFormatSaverCrypto::save(const Ref<Resource> &p_resource, const Str
} else {
ERR_FAIL_V(ERR_INVALID_PARAMETER);
}
- ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save Crypto resource to file '" + p_path + "'.");
+ ERR_FAIL_COND_V_MSG(err != OK, err, vformat("Cannot save Crypto resource to file '%s'.", p_path));
return OK;
}
diff --git a/core/crypto/crypto_core.cpp b/core/crypto/crypto_core.cpp
index 69a83284cc..13852d5177 100644
--- a/core/crypto/crypto_core.cpp
+++ b/core/crypto/crypto_core.cpp
@@ -70,7 +70,7 @@ int CryptoCore::RandomGenerator::_entropy_poll(void *p_data, unsigned char *r_bu
Error CryptoCore::RandomGenerator::init() {
int ret = mbedtls_ctr_drbg_seed((mbedtls_ctr_drbg_context *)ctx, mbedtls_entropy_func, (mbedtls_entropy_context *)entropy, nullptr, 0);
if (ret) {
- ERR_FAIL_COND_V_MSG(ret, FAILED, " failed\n ! mbedtls_ctr_drbg_seed returned an error" + itos(ret));
+ ERR_FAIL_COND_V_MSG(ret, FAILED, vformat(" failed\n ! mbedtls_ctr_drbg_seed returned an error %d.", ret));
}
return OK;
}
@@ -78,7 +78,7 @@ Error CryptoCore::RandomGenerator::init() {
Error CryptoCore::RandomGenerator::get_random_bytes(uint8_t *r_buffer, size_t p_bytes) {
ERR_FAIL_NULL_V(ctx, ERR_UNCONFIGURED);
int ret = mbedtls_ctr_drbg_random((mbedtls_ctr_drbg_context *)ctx, r_buffer, p_bytes);
- ERR_FAIL_COND_V_MSG(ret, FAILED, " failed\n ! mbedtls_ctr_drbg_seed returned an error" + itos(ret));
+ ERR_FAIL_COND_V_MSG(ret, FAILED, vformat(" failed\n ! mbedtls_ctr_drbg_seed returned an error %d.", ret));
return OK;
}