Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
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.