[Haskell-cafe] How to catch all exceptions that could be caught?
magicloud.magiclouds at gmail.com
Thu Jan 12 07:58:48 CET 2012
Yes, that is a problem. But consider my PS in original mail, I have no
idea what exception should I catch. Where could I get that
On Thu, Jan 12, 2012 at 2:49 PM, Ivan Lazar Miljenovic
<ivan.miljenovic at gmail.com> wrote:
> On 12 January 2012 17:34, Gregory Crosswhite <gcrosswhite at gmail.com> wrote:
>> On 01/12/12 13:03, Magicloud Magiclouds wrote:
>>> With Prelude.catch, I could write "catch () $ \_ -> return Nothing".
>>> But with Control.Exception.catch, I must specify a type for the "_".
>>> What should I do?
>> Use SomeException for the type, as it is the base of the exception
> But it is usually recommended that you *don't* do this, as it even
> captures Ctrl-c invocations:
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe