View Full Version : Exceptions in Try...Except statements
tutils
18-Oct-2005, 05:51 AM
I noticed that EurekaLog catches exceptions inside Try...Except statements. This is an unwanted behavior for me. Is there a way to turn this off?
admin
18-Oct-2005, 08:53 AM
tutils wrote:
> I noticed that EurekaLog catches exceptions inside Try...Except
> statements. This is an unwanted behavior for me. Is there a way to turn
> this off?
EurekaLog catches handled exceptions only if those are raised into a
"safecall" method, not any other.
Have you see a different behavior?
Can you explain to me how can reproduce it, please?
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
tutils
19-Oct-2005, 02:02 AM
I am sorry, I'm not able to reproduce it anymore.
I will post if it happens again.
Thanks for your prompt response.
tutils
19-Oct-2005, 08:25 PM
While I'm unable to reproduce it myself, I'm still getting reports from clients about this problem. Let me fully describe it.
My application sets a registry string value at startup, performed inside a Try...Except block. I'm getting a few reports from EurekaLog about this error: ERegistryException: Failed to set data for '<string name>'.
Shouldn't the fact that it happened inside a Try...Except block prevent this error from showing to the user?
Graeme Edwards
20-Oct-2005, 04:28 AM
try
Prepare;
ExecQuery;
except
on E: Exception do
begin
Case DType of
ftFloat,ftInteger:Result:=0;
ftString:Result:='';
end;
Close;
Exit;
end;
I am experiencing a similar problem where I have a section of code as above
where I wish to
handle the errors myself, but if Eureka log is turned on, then it takes over
and reports the
error to the user when I wish to handle it silently in the background.
I have tried turning off the Eureka Log before running this section of code
using
SetEurekaLogState(False); before the code is run and
SetEurekaLogState(True); after the code is finished.
however it appears that this creates other problems because after a certain
number of
errors, my program hangs up. It looks like Eureka log is still somehow
processing these exceptions
in some way.
"tutils" <tutils13@yahoo.com> wrote in message
news:tutils.1x5z1a@no-mx.news.eurekalog.com...
>
> While I'm unable to reproduce it myself, I'm still getting reports from
> clients about this problem. Let me fully describe it.
>
> My application sets a registry string value at startup, performed
> inside a Try...Except block. I'm getting a few reports from EurekaLog
> about this error: ERegistryException: Failed to set data for '<string
> name>'.
>
> Shouldn't the fact that it happened inside a Try...Except block prevent
> this error from showing to the user?
>
>
> --
> tutils
> ------------------------------------------------------------------------
> tutils's Profile: http://news.eurekalog.com/member.php?userid=74
> View this thread: http://news.eurekalog.com/showthread.php?t=130
>
admin
21-Oct-2005, 09:21 AM
Graeme Edwards wrote:
> try
> Prepare;
> ExecQuery;
> except
> on E: Exception do
> begin
>
> Case DType of
> ftFloat,ftInteger:Result:=0;
> ftString:Result:='';
> end;
>
> Close;
> Exit;
> end;
>
> I am experiencing a similar problem where I have a section of code as above
> where I wish to
> handle the errors myself, but if Eureka log is turned on, then it takes over
> and reports the
> error to the user when I wish to handle it silently in the background.
>
> I have tried turning off the Eureka Log before running this section of code
> using
>
> SetEurekaLogState(False); before the code is run and
> SetEurekaLogState(True); after the code is finished.
>
> however it appears that this creates other problems because after a certain
> number of
> errors, my program hangs up. It looks like Eureka log is still somehow
> processing these exceptions
> in some way.
Thank you for the detailed feedback.
I'm studying on.
I'll came back after it's resolution. :)
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
> "tutils" <tutils13@yahoo.com> wrote in message
> news:tutils.1x5z1a@no-mx.news.eurekalog.com...
>
>>While I'm unable to reproduce it myself, I'm still getting reports from
>>clients about this problem. Let me fully describe it.
>>
>>My application sets a registry string value at startup, performed
>>inside a Try...Except block. I'm getting a few reports from EurekaLog
>>about this error: ERegistryException: Failed to set data for '<string
>>name>'.
>>
>>Shouldn't the fact that it happened inside a Try...Except block prevent
>>this error from showing to the user?
>>
>>
>>--
>>tutils
>>------------------------------------------------------------------------
>>tutils's Profile: http://news.eurekalog.com/member.php?userid=74
>>View this thread: http://news.eurekalog.com/showthread.php?t=130
admin
21-Oct-2005, 02:55 PM
Graeme Edwards wrote:
> try
> Prepare;
> ExecQuery;
> except
> on E: Exception do
> begin
>
> Case DType of
> ftFloat,ftInteger:Result:=0;
> ftString:Result:='';
> end;
>
> Close;
> Exit;
> end;
>
> I am experiencing a similar problem where I have a section of code as above
> where I wish to
> handle the errors myself, but if Eureka log is turned on, then it takes over
> and reports the
> error to the user when I wish to handle it silently in the background.
>
> I have tried turning off the Eureka Log before running this section of code
> using
>
> SetEurekaLogState(False); before the code is run and
> SetEurekaLogState(True); after the code is finished.
>
> however it appears that this creates other problems because after a certain
> number of
> errors, my program hangs up. It looks like Eureka log is still somehow
> processing these exceptions
> in some way.
What EurekaLog version do you use?
I have tried with the following code and all works fine:
--------------------------------------------------
procedure EurekaLogTest;
begin
try
raise Exception.Create('Error');
except
on E: Exception do
begin
// Do something here...
Beep;
end;
end;
end;
--------------------------------------------------
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
> "tutils" <tutils13@yahoo.com> wrote in message
> news:tutils.1x5z1a@no-mx.news.eurekalog.com...
>
>>While I'm unable to reproduce it myself, I'm still getting reports from
>>clients about this problem. Let me fully describe it.
>>
>>My application sets a registry string value at startup, performed
>>inside a Try...Except block. I'm getting a few reports from EurekaLog
>>about this error: ERegistryException: Failed to set data for '<string
>>name>'.
>>
>>Shouldn't the fact that it happened inside a Try...Except block prevent
>>this error from showing to the user?
>>
>>
>>--
>>tutils
>>------------------------------------------------------------------------
>>tutils's Profile: http://news.eurekalog.com/member.php?userid=74
>>View this thread: http://news.eurekalog.com/showthread.php?t=130
admin
21-Oct-2005, 02:56 PM
tutils wrote:
> While I'm unable to reproduce it myself, I'm still getting reports from
> clients about this problem. Let me fully describe it.
>
> My application sets a registry string value at startup, performed
> inside a Try...Except block. I'm getting a few reports from EurekaLog
> about this error: ERegistryException: Failed to set data for '<string
> name>'.
>
> Shouldn't the fact that it happened inside a Try...Except block prevent
> this error from showing to the user?
What EurekaLog version do you use?
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
tutils
23-Oct-2005, 10:49 AM
I have tried with the following code and all works fine:
--------------------------------------------------
procedure EurekaLogTest;
begin
try
raise Exception.Create('Error');
except
on E: Exception do
begin
// Do something here...
Beep;
end;
end;
end;
--------------------------------------------------
I'm using EurekaLog 5.0.1. I tested your code, and it worked fine for me as well.
Is there a reason for Delphi to throw an error message during a Try...Except block only in some cases?
Graeme Edwards
23-Oct-2005, 01:14 PM
I am using 5.0.4 Enterprise version, and I am also using FIBPlus 5
components as well.
The exceptions that I am trying to handle myself would be caused by the
FIBPlus components
failing to complete a query correctly.
It could be that there is some conflict between FIBPlus and Eureka log
components.
"admin" <support@eurekalog.com> wrote in message
news:djarv8$mug$1@plesk.eurekalog.com...
> Graeme Edwards wrote:
>> try
>> Prepare;
>> ExecQuery;
>> except
>> on E: Exception do
>> begin
>>
>> Case DType of
>> ftFloat,ftInteger:Result:=0;
>> ftString:Result:='';
>> end;
>>
>> Close;
>> Exit;
>> end;
>>
>> I am experiencing a similar problem where I have a section of code as
>> above where I wish to
>> handle the errors myself, but if Eureka log is turned on, then it takes
>> over and reports the
>> error to the user when I wish to handle it silently in the background.
>>
>> I have tried turning off the Eureka Log before running this section of
>> code using
>>
>> SetEurekaLogState(False); before the code is run and
>> SetEurekaLogState(True); after the code is finished.
>>
>> however it appears that this creates other problems because after a
>> certain number of
>> errors, my program hangs up. It looks like Eureka log is still somehow
>> processing these exceptions
>> in some way.
>
> What EurekaLog version do you use?
>
> I have tried with the following code and all works fine:
>
> --------------------------------------------------
> procedure EurekaLogTest;
> begin
> try
> raise Exception.Create('Error');
> except
> on E: Exception do
> begin
> // Do something here...
> Beep;
> end;
> end;
> end;
> --------------------------------------------------
>
> --
> Best regards...
>
> Fabio Dell'Aria.
> ----------------
> http://www.eurekalog.com
> Catch every BUG showing line n.
>
>> "tutils" <tutils13@yahoo.com> wrote in message
>> news:tutils.1x5z1a@no-mx.news.eurekalog.com...
>>
>>>While I'm unable to reproduce it myself, I'm still getting reports from
>>>clients about this problem. Let me fully describe it.
>>>
>>>My application sets a registry string value at startup, performed
>>>inside a Try...Except block. I'm getting a few reports from EurekaLog
>>>about this error: ERegistryException: Failed to set data for '<string
>>>name>'.
>>>
>>>Shouldn't the fact that it happened inside a Try...Except block prevent
>>>this error from showing to the user?
>>>
>>>
>>>--
>>>tutils
>>>------------------------------------------------------------------------
>>>tutils's Profile: http://news.eurekalog.com/member.php?userid=74
>>>View this thread: http://news.eurekalog.com/showthread.php?t=130
admin
24-Oct-2005, 07:11 AM
tutils wrote:
> admin Wrote:
>
>>I have tried with the following code and all works fine:
>>
>>--------------------------------------------------
>>procedure EurekaLogTest;
>>begin
>>try
>>raise Exception.Create('Error');
>>except
>>on E: Exception do
>>begin
>>// Do something here...
>>Beep;
>>end;
>>end;
>>end;
>>--------------------------------------------------
>
> I'm using EurekaLog 5.0.1. I tested your code, and it worked fine for
> me as well.
>
> Is there a reason for Delphi to throw an error message during a
> Try...Except block only in some cases?
It's really strange.
I think this it's impossible.
Can you reproduce your problem with the last 5.0.l4 version, please?
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
admin
24-Oct-2005, 07:18 AM
Hi Edwards,
Graeme Edwards wrote:
> I am using 5.0.4 Enterprise version, and I am also using FIBPlus 5
> components as well.
> The exceptions that I am trying to handle myself would be caused by the
> FIBPlus components
> failing to complete a query correctly.
> It could be that there is some conflict between FIBPlus and Eureka log
> components.
This is a FIBPlus bug not an EurekaLog bug. :)
Read the following topics to obtain more details about it.
Complete discussion:
http://news.eurekalog.com/showthread.php?t=125
Only the solution:
http://news.eurekalog.com/showpost.php?p=413
A fix request is just posted to the FIBPlus support team.
--
Best regards...
Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG showing line n.
>
>
> [...]
Jonathan Neve[Microtec]
24-Oct-2005, 07:40 AM
admin wrote:
> This is a FIBPlus bug not an EurekaLog bug. :)
> Read the following topics to obtain more details about it.
>
> Complete discussion:
> http://news.eurekalog.com/showthread.php?t=125
>
> Only the solution:
> http://news.eurekalog.com/showpost.php?p=413
>
> A fix request is just posted to the FIBPlus support team.
Yes, apparently this bug was fixed in FIBPlus version 6.3, which is
currently in beta. Or if you prefer, I can send you a hot fix that
works for me. Note that I'm using BCB 5, and couldn't reproduce it on
other versions of BCB nor Delphi. If you're using BCB 5 or (perhaps)
Delphi 5, it is probably the same problem, if not, it might not be.
Just to be sure, do you get access violations in FIBSQLMonitor.pas?
--
Best regards,
Jonathan Neve
_______________
CopyTiger - advanced database replicator for Interbase/Firebird!
Web : http://www.microtec.fr/copycat/ct
_______________________________________
CopyCat - database replication components for Delphi/C++Builder!
Web : http://www.microtec.fr/copycat/cc
PekunZip
18-Jul-2008, 06:01 AM
I made a test app as follows to demostrate the problem:
1. Create New win 32 vcl app
2. Add button into form
3. Add ExceptionNotify code segment with code
EurekaExceptionRecord.CurrentModuleOptions.Excepti onDialogType := edtNone;
EurekaExceptionRecord.CurrentModuleOptions.EMailSe ndMode := esmNoSend;
4. Add button code:
try
PByte(nil)^ := 0;
except
end;
5. EurekaLog set to catch handled exceptions
Result: App does create .ELF file as expected but also AV window ála EL will be displayed which is not definitely correct.
How to fix this problem?
admin
18-Jul-2008, 01:17 PM
Hi,
for the handled exceptions you must use the HandledExceptionNotify event.
See here:
http://www.eurekalog.com/docs/handledexceptionnotifyhowto.html
PekunZip
20-Jul-2008, 04:02 PM
Hi,
for the handled exceptions you must use the HandledExceptionNotify event.
See here:
http://www.eurekalog.com/docs/handledexceptionnotifyhowto.html
Ahaa... that wasn't came up in my mind that there is different procedure for that.
(Umm... why's that?)
But thank you anyway, this will help me a lot.
-Pekka-
admin
21-Jul-2008, 07:35 AM
Hi,
I have created another event for compatibility with old EurekaLog versions.
Otherwise the same events that in the old 5.x version was raised only for unhandled exceptions, in the 6.x version, will be raised also for handled exceptions.
That's all! :)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.