mirror of
https://git.nerfingen.de/nerf/choirMail.git
synced 2025-06-08 01:31:16 +00:00
if we send an error mail, we also print the error to stderr
This commit is contained in:
parent
a460fd561f
commit
ab7c39b707
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue