exception-mailer 0.3 → 0.4
raw patch · 2 files changed
+3/−17 lines, 2 filesdep ~mime-mail
Dependency ranges changed: mime-mail
Files
- System/ExceptionMailer.hs +1/−15
- exception-mailer.cabal +2/−2
System/ExceptionMailer.hs view
@@ -16,7 +16,6 @@ import Data.String (fromString) import Data.Maybe import qualified Data.Text.Lazy as LT-import qualified Data.Text.Lazy.Encoding as LT import Control.Exception (SomeException, catch) import GHC.Conc (setUncaughtExceptionHandler) import Network.Mail.Mime@@ -70,7 +69,7 @@ mailError :: Address -> Address -> Maybe String -> String -> IO () mailError from to subj msg = do prog <- getProgName- m <- simpleMail' from to (fromString $ fromMaybe "Exception Mailer" subj)+ let m = simpleMail' from to (fromString $ fromMaybe "Exception Mailer" subj) (LT.concat ["Program: ", fromString $ prog ++ "\n" ,"Exception:\n", fromString msg]) renderSendMail m@@ -83,16 +82,3 @@ (\e2 -> errorM exceptionMailerTag $ "Unable to send email : "++show (e2 :: SomeException)) return () --- simpleMail' :: Monad m => Address -> Address -> Data.Text.Internal.Text -> LT.Text -> m Mail-simpleMail' from to subject plainBody =- return Mail {- mailFrom = from- , mailTo = [to]- , mailCc = []- , mailBcc = []- , mailHeaders = [ ("Subject", subject) ]- , mailParts =- [[ Part "text/plain; charset=utf-8" QuotedPrintableText Nothing []- $ LT.encodeUtf8 plainBody- ]]- }
exception-mailer.cabal view
@@ -1,5 +1,5 @@ name: exception-mailer-version: 0.3+version: 0.4 synopsis: Catch all runtime exceptions and send an email description: This module is designed to be used in production code when no runtime exceptions are expected. This module will catch any@@ -22,7 +22,7 @@ ghc-options: -W build-depends: base >=4 && < 5, text,- mime-mail,+ mime-mail >= 0.4.4, hslogger source-repository head