mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-10-23 08:42:27 +00:00
move tryError to Simplex.Messaging.Util (#191)
This commit is contained in:
1 parent
2ac903a2dd
commit
e07bedac0e
2 files changed
+4
-2
No files matched your search
@@ -50,3 +50,6 @@ liftError f = liftEitherError f . runExceptT
|
||||
|
||||
liftEitherError :: (MonadIO m, MonadError e' m) => (e -> e') -> IO (Either e a) -> m a
|
||||
liftEitherError f a = liftIOEither (first f <$> a)
|
||||
|
||||
tryError :: MonadError e m => m a -> m (Either e a)
|
||||
tryError action = (Right <$> action) `catchError` (pure . Left)
|
||||
Reference in new issue
Block a user