Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Util.Exceptions

Description

Utilities for exceptions.

Synopsis

Documentation

ignoreEnoent :: IO a -> IO (Maybe a) Source #

If op raised ENOENT, return Nothing.

ignoreEOF :: IO a -> IO (Maybe a) Source #

ignoreIOError :: IO a -> IO (Maybe a) Source #

Ignore all IO errors. This is useful when you want to see if a file exists, because some-file/x will not give ENOENT, but ENOTDIR, which is probably isIllegalOperation.

ignoreError :: Exception.Exception e => (e -> Bool) -> IO a -> IO (Maybe a) Source #

tryIO :: IO a -> IO (Either IO.Error.IOError a) Source #

Exception.try specialized to IOError.