alertmanager/notify
Max Inden 81b9a83f06 notify: Improve error handling (#1474)
- `tmplText` and `tmplHTML` are using a monad-style error handling [1].
This reduces the verbosity of the error logic, but introduces the risk
of forgetting the final error check. This patch does not remove this
coding-style, but ensures proper error checking in the Email and
PagerDuty notifier.

- Ensure to handle errors returned by `multipartWriter.Close()` and
`wc.Write(buffer.Bytes())` in `Email.Notify()`.

[1] https://www.innoq.com/en/blog/golang-errors-monads/

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
2018-07-23 14:04:40 +02:00
..
impl_test.go notify: Improve error handling (#1474) 2018-07-23 14:04:40 +02:00
impl.go notify: Improve error handling (#1474) 2018-07-23 14:04:40 +02:00
notify_test.go notify: notify resolved alerts properly (#1408) 2018-06-08 11:37:38 +02:00
notify.go notify: notify resolved alerts properly (#1408) 2018-06-08 11:37:38 +02:00