diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-10-31 20:14:36 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-10-31 20:14:36 -0500 |
commit | 163bf94d04342ad8d16086e95ea855a86d3699fc (patch) | |
tree | 6cdd9ec78a0db516c8516af7b0842b5efe426ae3 /core/io/file_access_zip.cpp | |
parent | 6ca36277abcfd587c8a61193f278899ec2bc5d32 (diff) | |
parent | 38f9769bc6d560373df961880f99aaaafaae00d9 (diff) | |
download | redot-engine-163bf94d04342ad8d16086e95ea855a86d3699fc.tar.gz |
Merge pull request #98091 from AThousandShips/improve_err_prints_core
[Core] Improve error messages with `vformat`
Diffstat (limited to 'core/io/file_access_zip.cpp')
-rw-r--r-- | core/io/file_access_zip.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index b33b7b35c3..41907d1a3f 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -116,7 +116,7 @@ void ZipArchive::close_handle(unzFile p_file) const { } unzFile ZipArchive::get_file_handle(const String &p_file) const { - ERR_FAIL_COND_V_MSG(!file_exists(p_file), nullptr, "File '" + p_file + " doesn't exist."); + ERR_FAIL_COND_V_MSG(!file_exists(p_file), nullptr, vformat("File '%s' doesn't exist.", p_file)); File file = files[p_file]; zlib_filefunc_def io; @@ -136,7 +136,7 @@ unzFile ZipArchive::get_file_handle(const String &p_file) const { io.free_mem = godot_free; unzFile pkg = unzOpen2(packages[file.package].filename.utf8().get_data(), &io); - ERR_FAIL_NULL_V_MSG(pkg, nullptr, "Cannot open file '" + packages[file.package].filename + "'."); + ERR_FAIL_NULL_V_MSG(pkg, nullptr, vformat("Cannot open file '%s'.", packages[file.package].filename)); int unz_err = unzGoToFilePos(pkg, &file.file_pos); if (unz_err != UNZ_OK || unzOpenCurrentFile(pkg) != UNZ_OK) { unzClose(pkg); |