Revert "async exception safety for coprocesses"

This reverts commit 7013798df5.
This commit is contained in:
Joey Hess 2020-07-06 15:11:28 -04:00
parent 6b8c961e1f
commit d66fc1a464
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 32 additions and 48 deletions

View file

@ -1,6 +1,6 @@
{- Simple IO exception handling (and some more)
-
- Copyright 2011-2020 Joey Hess <id@joeyh.name>
- Copyright 2011-2016 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
@ -20,7 +20,6 @@ module Utility.Exception (
bracketIO,
catchNonAsync,
tryNonAsync,
catchAsync,
tryWhenExists,
catchIOErrorType,
IOErrorType(..),
@ -88,14 +87,6 @@ catchNonAsync a onerr = a `catches`
, M.Handler (\ (e :: SomeException) -> onerr e)
]
{- Catches only async exceptions. -}
catchAsync :: MonadCatch m => m a -> (Either AsyncException SomeAsyncException -> m a) -> m a
catchAsync a onerr = a `catches`
[ M.Handler (\ (e :: AsyncException) -> onerr (Left e))
, M.Handler (\ (e :: SomeAsyncException) -> onerr (Right e))
, M.Handler (\ (e :: SomeException) -> throwM e)
]
tryNonAsync :: MonadCatch m => m a -> m (Either SomeException a)
tryNonAsync a = go `catchNonAsync` (return . Left)
where