tryJust

tryJust :: (Exception -> Maybe b) -> IO a -> IO (Either b a)
base Control.OldException
A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.
tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)
base Control.Exception.Base, base Control.Exception
A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.