diff options
Diffstat (limited to 'src/Propellor/Exception.hs')
| -rw-r--r-- | src/Propellor/Exception.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Propellor/Exception.hs b/src/Propellor/Exception.hs index 2e8754dc..463402e4 100644 --- a/src/Propellor/Exception.hs +++ b/src/Propellor/Exception.hs @@ -13,6 +13,7 @@ import Control.Exception (SomeAsyncException) #endif import Control.Monad.Catch import Control.Monad.IO.Class (MonadIO) +import Prelude -- | Catches all exceptions (except for `StopPropellorException` and -- `AsyncException` and `SomeAsyncException`) and returns FailedChange. @@ -34,4 +35,4 @@ catchPropellor' a onerr = a `catches` -- | Catches all exceptions (except for `StopPropellorException` and -- `AsyncException`). tryPropellor :: MonadCatch m => m a -> m (Either SomeException a) -tryPropellor a = (Right <$> a) `catchPropellor'` (pure . Left) +tryPropellor a = (return . Right =<< a) `catchPropellor'` (return . Left) |
