exception-mailer-0.4.1: Catch all runtime exceptions and send an email

Safe HaskellNone

System.ExceptionMailer

Contents

Description

Module to catch uncaught exceptions and send a notification email

Synopsis

Documentation

exceptionMailerTag :: StringSource

String tag used for logging to System.Log.Logger

setupExceptionMailerSource

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")

setupExceptionMailer'Source

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