Switch to new-style exception handling
authorIustin Pop <iustin@google.com>
Sun, 25 Mar 2012 14:26:02 +0000 (16:26 +0200)
committerIustin Pop <iustin@google.com>
Mon, 26 Mar 2012 08:54:08 +0000 (10:54 +0200)
commit30d25dd856cf539ca0dc798310180007abee7b6b
tree3c6b03b01c4c2a726d0395c7f0277f4599e63526
parentd80e3485f318815b01f51f717e4b678e92b2c8e8
Switch to new-style exception handling

Currently, we're using Prelude.catch to handle I/O errors in
htools. This style of error handling has been deprecated for a while,
but it still used to work without warnings.

However, the GHC release 7.4 has started to emit deprecation warnings
for it, so we change to the Control.Exception module; the code is a
bit less clean since we only care about I/O errors (but
Control.Exception deals with other error types too), so we have to
filter the exceptions.

Note that the new style exception handling is not really "new"; it has
existed since at least GHC 6.12, which is our oldest supported
compiler.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>
htools/Ganeti/HTools/ExtLoader.hs
htools/Ganeti/HTools/Rapi.hs
htools/htools.hs