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;

Comments

  1. Vin Colgin That will be $10 per use, thank you :-D

    ReplyDelete
  2. Cha-Ching, Cha-Ching:

    H2077: 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;

    ReplyDelete
  3. Sorry hint, you are drunk - go home ;-) or better known as the hint is wrong (IMHO)

    ReplyDelete

Post a Comment