| Safe Haskell | None |
|---|
System.ExceptionMailer
Contents
Description
Module to catch uncaught exceptions and send a notification email
- exceptionMailerTag :: String
- setupExceptionMailer :: Address -> Address -> Maybe String -> String -> IO ()
- setupExceptionMailer' :: String -> String -> Maybe String -> String -> IO ()
- setupExceptionMailer_adv :: Address -> Address -> Maybe String -> String -> (SomeException -> IO ()) -> IO ()
- mkAddress :: String -> String -> Address
- mailError :: Address -> Address -> Maybe String -> String -> IO ()
- data Address
Documentation
exceptionMailerTag :: StringSource
String tag used for logging to System.Log.Logger
Arguments
| :: Address | Make the email appear to be from this address |
| -> Address | Send the email to here |
| -> Maybe String | Subject |
| -> String | Prefix to put in the email head |
| -> IO () |
Setup the global exception notifier. This will catch any otherwise uncaught exceptions and send an email to the given address.
For example,
setupExceptionMailer (mkAddress "My Program" "noreply@example.com")
(mkAddress "Sysadmin" "sysadmin@example.com")
Arguments
| :: String | Make the email appear to be from this address |
| -> String | Send the email to here |
| -> Maybe String | Subject |
| -> String | Prefix to put in the email head |
| -> IO () |
Convenience version of setupExceptionMailer that just accepts the email addresses
setupExceptionMailer_advSource
Arguments
| :: Address | Make the email appear to be from this address |
| -> Address | Send the email to here |
| -> Maybe String | Subject |
| -> String | Prefix to put in the email head |
| -> (SomeException -> IO ()) | |
| -> IO () |
Setup the global exception notifier. Like setupExceptionMailer but allows a
custom action after the email is send
mkAddress :: String -> String -> AddressSource
Helper function to convert a name and email address into a proper Address
mailError :: Address -> Address -> Maybe String -> String -> IO ()Source
Send an error email. Exported so that it may be re-used from your own exception handling routines
Re-exported for convenience
data Address