On Wed, 2008-10-08 at 16:58 +0200, Philip K.F. Hölzenspies wrote:

> Is there any way to catch errors in functions in libraries (like the
> Prelude)?

Yes. Use Control.Exception.catch

The catch in the Prelude is only for catching IO errors. It cannot catch
errors thrown from pure code. Note that you can only catch exceptions in
IO.

> I use quite a few functions that produce errors (also from gtk2hs).
> These functions have been programmed using "error." Would these
> functions have been programmed with "abort," all would be honkey-dory.

Which gtk2hs functions that you're using use error? It would be
interesting to know which ones are a problem. I thought gtk2hs mostly
throws exceptions in IO (which can be caught in IO) except for some rare
cases which would always be programming errors.

If you can report them we can fix them.

Duncan

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to