Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ErrorNotification a = ErrorNotification {}
- data StackFrame = StackFrame {}
- data StackOptions = StackOptions {}
- data ExtraErrorInfo a = ExtraErrorInfo {
- errorURL :: Maybe Text
- errorCustomData :: Maybe (Map Text a)
- errorLocation :: Maybe Text
- errorUser :: Maybe UserInfo
- errorHTTPRequest :: Maybe HTTPRequest
- data HTTPRequest = HTTPRequest {}
- data UserInfo = UserInfo {}
- newtype Backend = Backend Text
- data YellerClient
- data YellerClientErrorHandler = YellerClientErrorHandler {
- handleAuthenticationErrors :: Response BodyReader -> IO ()
- handleIOErrors :: SomeException -> ErrorNotification Value -> IO ()
- data ApplicationEnvironment
- newtype ApplicationPackage = ApplicationPackage Text
- newtype YellerToken = YellerToken Text
- data YellerClientSettings = YellerClientSettings {}
- defaultClientSettings :: YellerClientSettings
- defaultErrorHandler :: YellerClientErrorHandler
- class ToError a
- sendError :: (ToError e, ToJSON a) => YellerClient -> e -> ExtraErrorInfo a -> IO ()
- client :: YellerClientSettings -> IO YellerClient
Documentation
data ErrorNotification a Source
An error notification. This is what is sent to Yeller's servers
ErrorNotification | |
|
Eq a => Eq (ErrorNotification a) | |
Show a => Show (ErrorNotification a) | |
ToJSON b => ToJSON (ErrorNotification b) |
data StackFrame Source
A line of the stacktrace
StackFrame | |
|
data StackOptions Source
Options to be associated with each | line in the stacktrace. Currently | only supports if the line is in | the application or not.
data ExtraErrorInfo a Source
Extra error information to be passed along with | an error. All fields are optional.
ExtraErrorInfo | |
|
Eq a => Eq (ExtraErrorInfo a) | |
Show a => Show (ExtraErrorInfo a) |
data HTTPRequest Source
lets you attach which http request was occurring when the | error happened | which lets you see the browser, if the request came from a spider | and so on
HTTPRequest | |
|
lets you attach which user the error happened with | which lets you count the total number of affected users
data YellerClient Source
A Yeller client.
| Build one with client
like so:
| client (defaultClientSettings { clientSettingsToken = YellerToken YOUR_TOKEN_HERE })
|
|
Used to keep persistent
| http connections alive, keep track of
| which endpoint to send to, and a bunch of
| data that's sent along with the error.
data YellerClientErrorHandler Source
An error handler, for dealing with errors when sending errors to Yeller's servers
| defaultErrorHandler
just prints to stderr when receiving errors, but you
| might want to override that to make it go to your logging system of choice.
YellerClientErrorHandler | |
|
data ApplicationEnvironment Source
the Environment your client is running in. If set to TestEnvironment
,
| then no errors will be reported (which you should do for development/testing)
newtype ApplicationPackage Source
The name of the package your application is in.
data YellerClientSettings Source
Options you pass when creating a client, usually done like this: | client (defaultClientSettings { clientSettingsToken = YellerToken YOUR_TOKEN_HERE })
YellerClientSettings | |
|
defaultClientSettings :: YellerClientSettings Source
the default client settings, used for constructing a client
A class for converting things into errors | Means you can pass both exceptions, and any | other error like values in your code
sendError :: (ToError e, ToJSON a) => YellerClient -> e -> ExtraErrorInfo a -> IO () Source
Sends an error to Yeller's servers | needs a client, something that can be turned into an error (via ToError), and | extra error information (which describes additional information to be sent | along with the error)
client :: YellerClientSettings -> IO YellerClient Source
Initializes a Yeller client, given some client settings | Call it like this with the default client settings: | client (defaultClientSettings { clientSettingsToken = YellerToken YOUR_TOKEN_HERE })