-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Middleware that communicates to Rollbar.
--   
--   Middleware that communicates to Rollbar.
@package wai-middleware-rollbar
@version 0.10.0


-- | Provides the payload for communicating with Rollbar.
module Network.Wai.Middleware.Rollbar.Payload
data Payload
RequestPayload :: Int -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Payload
[statusCode] :: Payload -> Int
[statusMessage] :: Payload -> Text
[userAgent] :: Payload -> Maybe Text
[range] :: Payload -> Maybe Text
[referer] :: Payload -> Maybe Text
ExceptionPayload :: Text -> Maybe Text -> Maybe Text -> Maybe Text -> Payload
[exception] :: Payload -> Text
[userAgent] :: Payload -> Maybe Text
[range] :: Payload -> Maybe Text
[referer] :: Payload -> Maybe Text
instance GHC.Show.Show Network.Wai.Middleware.Rollbar.Payload.Payload
instance GHC.Generics.Generic Network.Wai.Middleware.Rollbar.Payload.Payload
instance Data.Aeson.Types.ToJSON.ToJSON Network.Wai.Middleware.Rollbar.Payload.Payload


-- | Provides middleware for communicating with Rollbar.
--   
--   Currently has middleware for sending all server errors to Rollbar.
--   More to come shortly.
module Network.Wai.Middleware.Rollbar

-- | Set up the middleware properly The <tt>headers</tt> are what you want
--   removed from the request headers sent to Rollbar.
data Settings (headers :: [Symbol])
Settings :: AccessToken -> Maybe Branch -> Maybe CodeVersion -> Environment -> Settings

-- | Should have a scope "post_server_item".
[accessToken] :: Settings -> AccessToken

-- | Should be the branch of the running application.
--   
--   Will default to <tt>master</tt> if not set.
[branch] :: Settings -> Maybe Branch

-- | Should be the version of the running application.
[codeVersion] :: Settings -> Maybe CodeVersion

-- | Should be something meaningful to your program
--   
--   E.g. "development" or "production"
[environment] :: Settings -> Environment

-- | Middleware that catches exceptions, sends an item to Rollbar, and
--   rethrows the exception.
--   
--   Sends additional metadata including the request information.
exceptions :: RemoveHeaders headers => Settings headers -> Middleware

-- | Middleware that watches responses and sends an item to Rollbar if it
--   is a server error (5xx).
--   
--   Sends additional metadata including the request information.
requests :: RemoveHeaders headers => Settings headers -> Middleware
