[Haskell-cafe] Exceptions during exception unwinding

Brian Bloniarz phunge0 at hotmail.com
Thu Oct 1 09:07:07 EDT 2009


 <1254389201.7656.3.camel at localhost>
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


> On Thu=2C 2009-10-01 at 03:29 +0000=2C Brian Bloniarz wrote:
>> I.e. why does an exception raised during exception handling get
>> propagated past the exception that triggered the handler?
>
> Because it's the obvious and sensible thing to do and it what every
> other mainstream language with exceptions does.

Good to know ... C++ (the mainstream language I'm most familiar
with) treats throwing from a destructor during unwinding as a fatal
error.

>>> bracket openSomeHandle closeSomeHandle doAction
> Then catch and ignore the exception from closeSomeHandle (though not all
> exceptions or you'd block ^C etc). That said=2C how will you know that
> closeSomeHandle ever works if you always ignore any exceptions it
> raises?

I was suggesting having bracket ignore exceptions from closeSomeHandle
when doAction threw=2C not that it'd ignore any exceptions from
closeSomeHandle.

It's only the case where bracket has 2 exceptions to choose from that's
ambiguous=2C and I'm saying that there's a fair amount of code
out there that'd prefer to see the first one. Your point about ^C gets us i=
nto
an even grayer area -- maybe code would prefer to propagate whichever of
the 2 exceptions is asynchronous=2C or define a criterion to choose which
exception is more serious=2C who knows.

All these behaviors are easy to implement using the building blocks that
Control.Exception exports right now=2C you're right. So I'm free to build
my own bracket variants with different behavior and that's what I'll do.
I was just wondering if the default behavior that bracket/onException
provide (which are themselves built from catch/block/unblock) is the one
that most people want.

Thanks=2C
-Brian
 		 	   		  =0A=
_________________________________________________________________=0A=
Microsoft brings you a new way to search the web.  Try  Bing=99 now=0A=
http://www.bing.com?form=3DMFEHPG&publ=3DWLHMTAG&crea=3DTEXT_MFEHPG_Core_ta=
gline_try bing_1x1=


More information about the Haskell-Cafe mailing list