[Haskell-cafe] Re: Takusen - error handling and DBM monad

Bayley, Alistair Alistair_Bayley at invescoperpetual.co.uk
Thu Feb 1 11:18:31 EST 2007

> From: haskell-cafe-bounces at haskell.org 
> [mailto:haskell-cafe-bounces at haskell.org] On Behalf Of Al Falloon
> Bayley, Alistair wrote:
> > Al Falloon wrote:
> >> what does withSession return if there is a DBException?
> > 
> > Well, whatever the handler returns, same as with any other exception
> > handler. Note that this must have the same type as whatever 
> withSession
> > returns, and this constraint is enforced by the type of 
> catch/catchDB:
> Sorry, I wasn't clear. What does it return when there is an uncaught 
> exception? It sounds like it raises an exception in IO. Is 
> this correct?

Well, a function raising an uncaught exception doesn't really return
anything - it's raised an exception. I'm not clear on the semantics of
exceptions in Haskell, but if you don't catch it then eventually it
reaches the RTS, which will halt your program with an uncaught exception
error. If you're asking if it propagates up to the RTS, then the answer
is yes. The downside is that because it's a dynamic exception, the RTS
can't/won't show anything other than "uncaught dynamic exception", which
isn't helpful.

Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.

More information about the Haskell-Cafe mailing list