diff --git a/README.md b/README.md index 038d91f..944513c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ this depends on your local cabal cache. - [ ] Add the nix modules to the flake - [ ] Better Error handling - [x] Find out which exceptions the SMTP module throws - - [ ] also log to stderr if we send an error E-Mail + - [x] also log to stderr if we send an error E-Mail - [ ] move from MonadFail to MonadError from Control.Monad.Except - [ ] Split config into secrets and non secret config - [ ] make the pad url configurable diff --git a/app/Main.hs b/app/Main.hs index cc6c243..65ef276 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -25,7 +25,9 @@ reportErrorLocal :: MonadIO m => String -> m () reportErrorLocal = liftIO . hPutStr stderr reportErrorMail :: MonadIO m => Config -> String -> m () -reportErrorMail config error' = send (mailDomain config) (mailUsername config) (mailPassword config) (mailErrorTo config) (mailFrom config) "choirMail Error" (LT.pack error') +reportErrorMail config error' = do + reportErrorLocal error' + send (mailDomain config) (mailUsername config) (mailPassword config) (mailErrorTo config) (mailFrom config) "choirMail Error" (LT.pack error') findChoirDay :: Day -> [MailRecord] -> Either String MailRecord findChoirDay today table = maybe