really ugly exception handling... maks no fun wading through such code...
really ugly exception handling... maks no fun wading through such code...
...
except
// During testrun we just log and don't raise
on E: Exception do begin
if Options.IsTestRun and (E is EXXXImportException) then begin
if E.InnerException <> nil then
DoLog(CoreRStr.NIS_IMPORTCSV_ERROR + ' ' + E.Message + ' ' +
CoreRStr.sReason + ': ' + E.InnerException.ClassName + ': ' + E.InnerException.Message)
else
DoLog(CoreRStr.NIS_IMPORTCSV_ERROR + ' ' + E.Message);
end else
raise;
end;
end;
...
except
// During testrun we just log and don't raise
on E: Exception do begin
if Options.IsTestRun and (E is EXXXImportException) then begin
if E.InnerException <> nil then
DoLog(CoreRStr.NIS_IMPORTCSV_ERROR + ' ' + E.Message + ' ' +
CoreRStr.sReason + ': ' + E.InnerException.ClassName + ': ' + E.InnerException.Message)
else
DoLog(CoreRStr.NIS_IMPORTCSV_ERROR + ' ' + E.Message);
end else
raise;
end;
end;
Vin Colgin That will be $10 per use, thank you :-D
ReplyDeleteCha-Ching, Cha-Ching:
ReplyDeleteH2077: Value assigned to 'rc' never used (Delphi)
function Foo(): boolean;
var
rc : boolean;
MyObj : TMyObj;
begin
rc := FALSE:
MyObj := TMyObj.create();
try
try
MyObj.DoSomeStuff();
rc := MyObj.DidMyStuffGetDone();
except
end;
finally
MyObj.Free();
end;
result := rc;
end;
Sorry hint, you are drunk - go home ;-) or better known as the hint is wrong (IMHO)
ReplyDelete