realbasic-nug
[Top] [All Lists]

Re: Sanity check: Finally

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Sanity check: Finally
From: Ed Kleban <Ed at Kleban dot com>
Date: Fri, 30 Dec 2005 22:45:37 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcYNxQrySbkDMXm4EdqyhgANk0o3Jg==
Thread-topic: Sanity check: Finally


On 12/30/05 10:36 PM, "Norman Palardy" <npalardy at great-white-software dot 
com>
wrote:

> 
> On Dec 30, 2005, at 9:28 PM, Adam Ernst wrote:
> 
>> On Dec 30, 2005, at 10:22 PM, Ed Kleban wrote:
>> 
>>> I.e. is the finally clause guaranteed to execute before the catch
>>> clause
>>> raises the error again?
>> 
>> I'm not sure. The documentation states:
>> 
>>> Code in this block will be executed even if an exception has occured,
>>> whether the exception was handled or not.
>> 
>> That could be read either way: that first the exception is handled,
>> including propagating it all the way up the chain, and then the
>> finally block executes, OR that finally will be executed first, then
>> the exception is handled.
>> 

Which is why I'm asking :)   We'll see how Mars or some of the other
REALfolk claim it is supposed to work.


>> Personally, I'd bet that the exception is propagated first, then the
>> finally block is called,

Except of course that wouldn't make sense and in fact would make the use of
a finally clause pretty useless.

>> but I'm too lazy to test that...
>> 
> And there are exceptions that can not be caught using try catch
> 
> See bug report ID otrltbzq
> 
> and it still applies in 2005r4
> 

Ah!  Very good to know.  Hopefully this isn't a problem with user thrown
exceptions and is only a limitation of the intrinsic fatal exceptions such
as out of bounds and use of a null pointer -- after which it's not clear you
can trust much of anything.

Thanks!
--Ed
   


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>