Don't catch async exceptions
This commit is contained in:
1 parent
27f271691c
commit
036473ab81
3 files changed
+33
-10
No files matched your search
@@ -16,7 +16,7 @@ import Data.Void (Void)
|
||||
import Control.Monad.IO.Class (MonadIO)
|
||||
import Control.Monad.Catch (MonadCatch, MonadMask)
|
||||
import Katip (KatipContext, logFM, ls)
|
||||
import Control.Retry (RetryStatus(..), recovering, fullJitterBackoff, capDelay)
|
||||
import Control.Retry (RetryStatus(..), recovering, fullJitterBackoff, capDelay, skipAsyncExceptions)
|
||||
import Control.Monad (when)
|
||||
import Katip.Core (Severity(..))
|
||||
|
||||
@@ -41,7 +41,7 @@ instance Exception SupervisorException
|
||||
-- restarted instead of escalated.
|
||||
supervised :: (MonadIO m, MonadCatch m, KatipContext m, MonadMask m) => Text -> m Void -> m Void
|
||||
supervised name action = checkpoint (Annotation name) $ do
|
||||
recovering retryPolicy handlers $ \RetryStatus{rsIterNumber} -> do
|
||||
recovering retryPolicy (skipAsyncExceptions ++ handlers) $ \RetryStatus{rsIterNumber} -> do
|
||||
when (rsIterNumber > 0) $ logFM WarningS $ ls $ "Child crashed, retry no " <> show rsIterNumber
|
||||
action
|
||||
where
|
||||
|
||||
Reference in new issue
Block a user