[Haskell-cafe] Exceptions during exception unwinding
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"
> 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
>>> 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
I was suggesting having bracket ignore exceptions from closeSomeHandle
when doAction threw=2C not that it'd ignore any exceptions from
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=
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.
Microsoft brings you a new way to search the web. Try Bing=99 now=0A=
More information about the Haskell-Cafe