wolf 0.3.6 → 0.3.7
raw patch · 3 files changed
+20/−13 lines, 3 files
Files
- Shakefile.hs +2/−2
- src/Network/AWS/Wolf/Ctx.hs +17/−10
- wolf.cabal +1/−1
Shakefile.hs view
@@ -33,8 +33,8 @@ -- | sanity -- fake' pats "sanity" $ const $- need [ fakeFile "build-error", "lint" ]+ need [ fakeFile "build-error", fakeFile "lint" ] -- | Default things to run. --- want [ "build-error", "lint", "format" ]+ want [ fakeFile "sanity", fakeFile "format" ]
src/Network/AWS/Wolf/Ctx.hs view
@@ -23,6 +23,13 @@ import Network.AWS.Wolf.Prelude import Network.AWS.Wolf.Types +-- | Handler for exceptions, traces and rethrows.+--+catcher :: MonadCtx c m => SomeException -> m a+catcher e = do+ traceError "exception" [ "error" .= displayException e ]+ throwIO e+ -- | Run configuration context. -- runConfCtx :: MonadCtx c m => Conf -> TransT ConfCtx m a -> m a@@ -33,14 +40,14 @@ , "prefix" .= (conf ^. cPrefix) ] c <- view ctx <&> cPreamble <>~ preamble- runTransT (ConfCtx c conf) action+ runTransT (ConfCtx c conf) $ catch action catcher -- | Update configuration context's preamble. -- preConfCtx :: MonadConf c m => Pairs -> TransT ConfCtx m a -> m a preConfCtx preamble action = do c <- view confCtx <&> cPreamble <>~ preamble- runTransT c action+ runTransT c $ catch action catcher -- | Run amazon context. --@@ -48,14 +55,14 @@ runAmazonCtx action = do c <- view confCtx e <- newEnv Oregon $ FromEnv "AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY" mempty- runTransT (AmazonCtx c e) action+ runTransT (AmazonCtx c e) $ catch action catcher -- | Update amazon context's preamble. -- preAmazonCtx :: MonadAmazon c m => Pairs -> TransT AmazonCtx m a -> m a preAmazonCtx preamble action = do c <- view amazonCtx <&> cPreamble <>~ preamble- runTransT c action+ runTransT c $ catch action catcher -- | Run amazon store context. --@@ -64,14 +71,14 @@ let preamble = [ "uid" .= uid ] c <- view amazonCtx <&> cPreamble <>~ preamble p <- (-/- uid) . view cPrefix <$> view ccConf- runTransT (AmazonStoreCtx c uid p) action+ runTransT (AmazonStoreCtx c uid p) $ catch action catcher -- | Update amazon context's preamble. -- preAmazonStoreCtx :: MonadAmazonStore c m => Pairs -> TransT AmazonStoreCtx m a -> m a preAmazonStoreCtx preamble action = do c <- view amazonStoreCtx <&> cPreamble <>~ preamble- runTransT c action+ runTransT c $ catch action catcher -- | Run amazon work context. --@@ -79,14 +86,14 @@ runAmazonWorkCtx queue action = do let preamble = [ "queue" .= queue ] c <- view amazonCtx <&> cPreamble <>~ preamble- runTransT (AmazonWorkCtx c queue) action+ runTransT (AmazonWorkCtx c queue) $ catch action catcher -- | Update amazon context's preamble. -- preAmazonWorkCtx :: MonadAmazonWork c m => Pairs -> TransT AmazonWorkCtx m a -> m a preAmazonWorkCtx preamble action = do c <- view amazonWorkCtx <&> cPreamble <>~ preamble- runTransT c action+ runTransT c $ catch action catcher -- | Run amazon decision context. --@@ -94,11 +101,11 @@ runAmazonDecisionCtx p hes action = do let preamble = [ "name" .= (p ^. pStart ^. tName) ] c <- view amazonCtx <&> cPreamble <>~ preamble- runTransT (AmazonDecisionCtx c p hes) action+ runTransT (AmazonDecisionCtx c p hes) $ catch action catcher -- | Update amazon context's preamble. -- preAmazonDecisionCtx :: MonadAmazonDecision c m => Pairs -> TransT AmazonDecisionCtx m a -> m a preAmazonDecisionCtx preamble action = do c <- view amazonDecisionCtx <&> cPreamble <>~ preamble- runTransT c action+ runTransT c $ catch action catcher
wolf.cabal view
@@ -1,5 +1,5 @@ name: wolf-version: 0.3.6+version: 0.3.7 synopsis: Amazon Simple Workflow Service Wrapper. description: Wolf is a wrapper around Amazon Simple Workflow Service. homepage: https://github.com/swift-nav/wolf