PDA

View Full Version : 6.0.15: try..except no longer working in initialization block


Frank Schmitt
30-Jul-2008, 10:00 AM
Hi!

After upgrading from EurekaLog 6.0.11 to 6.0.15, we noticed some of our
applications throwing errors on startup.

Reason: The new version doesn't handle try..except blocks called from
initialization blocks correctly.

Reproduce:
- create a new application
- add the following unit to your project:

unit TryExceptNotWorkingConsoleDemoUnit;

interface

implementation

uses SysUtils;

procedure procThatCatchesException;
begin
try
raise Exception.Create('this should be handled');
except
on e: Exception do
end;
end;

initialization
procThatCatchesException;
end.

This will raise an EurekaLog dialog.
I consider this a severe bug - please fix ASAP.

Kind regards
Frank Schmitt

Surinder
30-Jul-2008, 12:55 PM
Hi,

I'm having exactly the same issue. Just upgraded from version 6.0.14 to 6.0.15. The first application I recompiled and ran started showing exceptions. I've also traced this to the initialization section. In the example below (sorry about no indents) the exception should be trapped but it isn't. A dialog appears saying "Floating point division by zero". If I call the Initialise procedure using a button click, then it works fine with no exception dialog appearing. I've reverted back to version 6.0.14 which doesn't have this problem.

I agree with Frank that this is a serious bug.

Kind regards,
Surinder

unit Unit2;

interface

uses
SysUtils, Dialogs;

procedure Initialise;

implementation

procedure Initialise;
var
i: Double;
begin
try
i := 10;
i := i / 0; // this will cause a divide by zero exception
ShowMessage(FloatToStr(i));
except

end;
end;


initialization
Initialise;

finalization

end.

admin
31-Jul-2008, 05:20 AM
Hi,

I have just fount and fixed it on the last EurekaLog 6.0.16 rc 3.

Try it and tell back to me your results, OK? ;)

Frank Schmitt
31-Jul-2008, 08:14 AM
admin wrote:
> Hi,
>
> I have just fount and fixed it on the last EurekaLog 6.0.16 rc 3.
>
> Try it and tell back to me your results, OK? ;)

Works for me (6.0.16 rc 4).
Thanks a lot for the quick response & kind regards
Frank

admin
31-Jul-2008, 01:24 PM
Hi,

you're welcome! :)

MrCOLOMBO
25-Aug-2008, 08:51 AM
EurekaLog-6.0.16_RC_5-Ent
Delphi 2007

Created standard VCL forms application and added this code to unit1.pas.

initialization
PByte(0)^ := 0;
finalization

Got 2 error exception dialogs.
First popups Eureka log exception dialog. I click "ok".
Dialog disappears and native borland dialog appears with the same Exception message.

If I put the same code outside initialization (say in Button OnClick handler) - I get only one Eureka dialog per exception.

Why?

admin
27-Aug-2008, 05:18 PM
Hi,

I have just solved this in the last just released EurekaLog 6.0.16.

try it and tell back to me your results, OK? :)

MrCOLOMBO
28-Aug-2008, 02:37 AM
This works fine for me now.
Thank you for a quick support.

admin
28-Aug-2008, 08:46 AM
You're welcome! ;)