- file system error management refactoring.
This commit is contained in:
parent
145450a044
commit
1dc47f91c2
19 changed files with 288 additions and 152 deletions
|
|
@ -250,10 +250,13 @@ int FDirectoryLump::FillCache()
|
|||
Cache = new char[LumpSize];
|
||||
if (!fr.OpenFile(mFullPath))
|
||||
{
|
||||
memset(Cache, 0, LumpSize);
|
||||
return 0;
|
||||
throw FileSystemException("unable to open file");
|
||||
}
|
||||
auto read = fr.Read(Cache, LumpSize);
|
||||
if (read != LumpSize)
|
||||
{
|
||||
throw FileSystemException("only read %d of %d bytes", (int)read, (int)LumpSize);
|
||||
}
|
||||
fr.Read(Cache, LumpSize);
|
||||
RefCount = 1;
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue