summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f6c01c)
raw | patch | inline | side by side (parent: 6f6c01c)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 9 Sep 2023 17:41:12 +0000 (20:41 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 9 Sep 2023 17:41:12 +0000 (20:41 +0300) |
src/shared/WADEDITOR_dfzip.pas | patch | blob | history |
index 7412af8a12aea7c08fb4a57ed902829e9ec76c03..ce2ad6fb270e76ac7fb0f9aadafcc28eb92ae8b9 100644 (file)
Result := True;
except
s.Free();
- raise;
end;
end;
end;
Assert(p.csize = p.usize);
GetMem(ptr, p.usize);
try
- src.ReadBuffer(ptr[0], p.usize);
- Result := True;
- except
- FreeMem(ptr);
+ try
+ src.ReadBuffer(ptr[0], p.usize);
+ Result := True;
+ except
+ FreeMem(ptr);
+ raise;
+ end;
+ except on e: EReadError do
+ if gWADEditorLogLevel >= DFWAD_LOG_WARN then
+ e_WriteLog('DFZIP: Failed to read STOREd data, reason: ' + e.Message, MSG_WARNING);
end;
end;
ZIP_COMP_DEFLATE:
Result := True;
except
FreeMem(ptr);
+ raise;
end;
finally
tmp.Free();
end;
except
- on e: Exception do
+ on e: EStreamError do
begin
if gWADEditorLogLevel >= DFWAD_LOG_INFO then
- e_WriteLog('DFZIP: Failed to decompress by DEFLATE method, reason: ' + e.Message, MSG_WARNING);
+ e_WriteLog('DFZIP: Failed to decompress DEFLATEd data, reason: ' + e.Message, MSG_WARNING);
raise e;
end;
end;
otherwise
- raise Exception.Create('Unknown compression method: ' + IntToStr(p.comp));
+ if gWADEditorLogLevel >= DFWAD_LOG_INFO then
+ e_WriteLog('DFZIP: Unsupported compression method: ' + IntToStr(p.comp), MSG_WARNING);
end;
end
else
ZIP_COMP_AE:
raise Exception.Create('Encrypted archives not supported');
otherwise
- raise Exception.Create('Unsupported compression method ' + IntToStr(comp));
+ raise Exception.Create('Unknown compression method ' + IntToStr(comp));
end;
// TODO: check bit 11 (UTF8 name and comment)
GetMem(name, UInt32(fnlen) + 1);
raise Exception.Create('EOCD not found (corrupted file?)');
end
else
- raise Exception.Create('Not DFZIP file');
+ raise Exception.Create('Not DFZIP formated file');
end;
function TZIPEditor.ReadFile2(FileName: String): Boolean;
if gWADEditorLogLevel >= DFWAD_LOG_INFO then
e_WriteLog('ZIP: Failed to read ZIP from file ' + FileName + ', reason: ' + e.Message, MSG_WARNING);
FreeWAD();
- raise e;
end;
end;
except
on e: EFOpenError do
begin
if gWADEditorLogLevel >= DFWAD_LOG_INFO then
- e_WriteLog('ZIP: Failed to open file ' + FileName + ', reason: ' + e.Message, MSG_WARNING);
+ e_WriteLog('DFZIP: Failed to open file ' + FileName + ', reason: ' + e.Message, MSG_WARNING);
if FileExists(FileName) then
FLastError := DFWAD_ERROR_CANTOPENWAD
else
on e: Exception do
begin
if gWADEditorLogLevel >= DFWAD_LOG_INFO then
- e_WriteLog('ZIP: Failed to read ZIP from memory, reason: ' + e.Message, MSG_WARNING);
+ e_WriteLog('DFZIP: Failed to read ZIP from memory, reason: ' + e.Message, MSG_WARNING);
FreeWAD();
- raise e;
end;
end;
end;