@@ -16,8 +16,7 @@ import Control.Applicative as A
1616import Control.Concurrent
1717import Control.Concurrent.Async
1818import Control.Concurrent.STM.TBMQueue
19−import Control.Exception.Base
20−import Control.Exception.Enclosed
19+import qualified Control.Exception.Safe as EX
2120import Control.Monad
2221import Control.Monad.Catch
2322import Control.Monad.IO.Class
@@ -28,7 +27,7 @@ import Control.Retry (RetryPolicy,
2827 recovering)
2928import Data.Aeson
3029import Data.ByteString.Lazy (ByteString)
31−import Data.List.NonEmpty (NonEmpty(..))
30+import Data.List.NonEmpty (NonEmpty (..))
3231import Data.Monoid ((<>))
3332import Data.Text (Text)
3433import qualified Data.Text as T
@@ -282,21 +281,21 @@ mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
282281 -- create or update
283282 res <- putTemplate prx tpl tplName
284283 unless (statusIsSuccessful (responseStatus res)) $
285− liftIO $ throwIO (CouldNotPutTemplate res)
284+ liftIO $ EX.throwIO (CouldNotPutTemplate res)
286285 else do
287286 ixExists <- indexExists prx ix
288287 if ixExists
289288 then do
290289 res <- updateIndexSettings prx (toUpdatabaleIndexSettings prx essIndexSettings) ix
291290 unless (statusIsSuccessful (responseStatus res)) $
292− liftIO $ throwIO (CouldNotUpdateIndexSettings res)
291+ liftIO $ EX.throwIO (CouldNotUpdateIndexSettings res)
293292 else do
294293 r1 <- createIndex prx essIndexSettings ix
295294 unless (statusIsSuccessful (responseStatus r1)) $
296− liftIO $ throwIO (CouldNotCreateIndex r1)
295+ liftIO $ EX.throwIO (CouldNotCreateIndex r1)
297296 r2 <- putMapping prx ix mapping base
298297 unless (statusIsSuccessful (responseStatus r2)) $
299− liftIO $ throwIO (CouldNotCreateMapping r2)
298+ liftIO $ EX.throwIO (CouldNotCreateMapping r2)
300299
301300 workers <- replicateM (unEsPoolSize essPoolSize) $ async $
302301 startWorker cfg env mapping q
@@ -421,7 +420,7 @@ startWorker EsScribeCfg {..} env mapping q = go
421420 popped <- atomically $ readTBMQueue q
422421 case popped of
423422 Just (ixn, v) -> do
424− sendLog ixn v `catchAny` eat
423+ sendLog ixn v `EX.catchAny` eat
425424 go
426425 Nothing -> return ()
427426 prx :: Typeable.Proxy v
@@ -434,8 +433,8 @@ startWorker EsScribeCfg {..} env mapping q = go
434433 eat _ = return ()
435434 handler _ = Handler $ \e ->
436435 case fromException e of
437− Just (_ :: AsyncException) -> return False
438− _ -> return True
436+ Just (_ :: EX.SomeAsyncException) -> return False
437+ _ -> return True
439438
440439
441440-------------------------------------------------------------------------------