mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Added better file open error messages to the file provider
This commit is contained in:
2
lib/external/libwolv
vendored
2
lib/external/libwolv
vendored
Submodule lib/external/libwolv updated: 6c26a49338...ef8dd504a9
@@ -202,8 +202,10 @@ namespace hex::plugin::builtin {
|
||||
size_t fileSize = 0x00;
|
||||
{
|
||||
wolv::io::File file(m_path, wolv::io::File::Mode::Read);
|
||||
if (!file.isValid())
|
||||
if (!file.isValid()) {
|
||||
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(file.getOpenError().value_or(0))));
|
||||
return false;
|
||||
}
|
||||
|
||||
fileSize = file.getSize();
|
||||
}
|
||||
@@ -231,11 +233,6 @@ namespace hex::plugin::builtin {
|
||||
m_readable = true;
|
||||
m_writable = true;
|
||||
|
||||
if (!wolv::io::fs::exists(m_path)) {
|
||||
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(ENOENT)));
|
||||
return false;
|
||||
}
|
||||
|
||||
wolv::io::File file(m_path, wolv::io::File::Mode::Write);
|
||||
if (!file.isValid()) {
|
||||
m_writable = false;
|
||||
@@ -243,7 +240,7 @@ namespace hex::plugin::builtin {
|
||||
file = wolv::io::File(m_path, wolv::io::File::Mode::Read);
|
||||
if (!file.isValid()) {
|
||||
m_readable = false;
|
||||
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(errno)));
|
||||
this->setErrorMessage(hex::format("hex.builtin.provider.file.error.open"_lang, m_path.string(), std::system_category().message(file.getOpenError().value_or(0))));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user