added error handling to the web request (and changed from req to wreq)

This commit is contained in:
Dennis Frieberg 2025-06-07 03:33:27 +02:00
parent 6f50add62a
commit a460fd561f
Signed by: nerf
GPG key ID: 7C58AFED036072C5
5 changed files with 44 additions and 34 deletions

View file

@ -12,14 +12,14 @@ Just run the binary to send a mail, it requires exactly one
parameter that points to a config file.
### Configuration
The config file is a toml file, even though it as of now makes not really use
The config file is a toml file, even though as of now it makes not really use
of any toml features.
```toml
[mail]
domain = "the domain of the smtp server to send messages with"
user = "the username on the smtp server"
password = "the passwond on the smtp server"
password = "the password on the smtp server"
to = "the mail to send to"
from = "the sender of the mail"
errorTo = "the address to send a mail to in case of error"
@ -30,10 +30,13 @@ If you run `nix develop` you get a set up kakoune with an lsp. Be aware
this depends on your local cabal cache.
# TODO
- [] Better E-Mail generation
- [] Add the nix modules to the flake
- [] Better Error handling
- [] Find out which exceptions the SMTP module throws
- [] Split config into secrets and non secret config
- [] make the pad url configurable
- [ ] Better E-Mail generation
- [ ] 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
- [ ] move from MonadFail to MonadError from Control.Monad.Except
- [ ] Split config into secrets and non secret config
- [ ] make the pad url configurable
- [x] Clean up Strict vs Lazy Text
- [ ] decide finally if we want to use wreq or req and don't flip flop between both libs