Safe Haskell | None |
---|
This package contains utilities to log errors in Scotty actions using raven-haskell.
- guardIO :: SentryService -> String -> Maybe String -> Maybe String -> IO a -> ActionM a
- logError :: SentryService -> String -> String -> (SentryRecord -> SentryRecord) -> ActionM ()
- scottyHttpInterface :: ActionM (SentryRecord -> SentryRecord)
Documentation
:: SentryService | Configured Sentry service. |
-> String | Logger name. |
-> Maybe String | Exception type name. |
-> Maybe String | Action module name. |
-> IO a | Action to run. |
-> ActionM a | Result in a Scotty ActionM monad. |
A liftIO alternative that logs unhandled exceptions. The function itself is verbose in arguments and designed to be curried and reused.
main = do raven <- initRaven … let hereBeDragons = guardIO raven "my.logger" (Just "DragonsError") (Just "My.Inner.Dragons") scotty 8000 $ do post "/some/action/" $ do arg1 <- param "arg1" arg2 <- param "arg2" hereBeDragons $ dragonsIO arg1 arg2
:: SentryService | A configured Sentry service. |
-> String | Logger name. |
-> String | Message to log. |
-> (SentryRecord -> SentryRecord) | Additional interfaces or other updates. |
-> ActionM () |
Log an error in an ActionM monad, collecting request data.
scottyHttpInterface :: ActionM (SentryRecord -> SentryRecord)Source
Collect request parameters for a HTTP sentry interface.