mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 13:03:11 +01:00
Provide more info in case of write failure
This commit is contained in:
@@ -184,9 +184,11 @@ namespace OpenRCT2
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (fwrite(buffer, static_cast<size_t>(length), 1, _file) != 1)
|
||||
if (auto count = fwrite(buffer, static_cast<size_t>(length), 1, _file); count != 1)
|
||||
{
|
||||
throw IOException("Unable to write to file.");
|
||||
std::string error = "Unable to write " + std::to_string(length) + " bytes to file. Count = " + std::to_string(count)
|
||||
+ ", errno = " + std::to_string(errno);
|
||||
throw IOException(error);
|
||||
}
|
||||
|
||||
uint64_t position = GetPosition();
|
||||
|
||||
Reference in New Issue
Block a user