mirror of https://github.com/OpenRCT2/OpenRCT2.git
Provide more info in case of write failure
This commit is contained in:
parent
15fad6b979
commit
c25ebdd1c8
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue