Just package:haskell-gi-base
This will catch just a specific GError exception. If you need to catch
a range of related errors,
catchGErrorJustDomain is probably
more appropriate. Example:
do image <- catchGErrorJust PixbufErrorCorruptImage
loadImage
(\errorMessage -> do log errorMessage
return mssingImagePlaceholder)
Catch all GErrors from a particular error domain. The handler function
should just deal with one error enumeration type. If you need to catch
errors from more than one error domain, use this function twice with
an appropriate handler functions for each.
catchGErrorJustDomain
loadImage
(\err message -> case err of
PixbufErrorCorruptImage -> ...
PixbufErrorInsufficientMemory -> ...
PixbufErrorUnknownType -> ...
_ -> ...)
When the given value is of "Just a" form, execute the given action,
otherwise do nothing.