[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Mathieu Othacehe |
Date: |
Wed, 24 Feb 2021 06:43:22 -0500 (EST) |
branch: master
commit 370a4ad2ca0e3bf9317a117eeb78846a5a39975d
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Wed Feb 24 12:10:32 2021 +0100
notification: Catch notifications errors.
* src/cuirass/notification.scm (notification-email, notification-mastodon):
Catch notification errors.
---
src/cuirass/notification.scm | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/cuirass/notification.scm b/src/cuirass/notification.scm
index ddadac0..3de7f5b 100644
--- a/src/cuirass/notification.scm
+++ b/src/cuirass/notification.scm
@@ -105,16 +105,26 @@ the detailed information about this build here: ~a."
(server (assq-ref notification #:server))
(subject (notification-subject notification))
(text (notification-text notification)))
- (send-email server
- #:from from
- #:to to
- #:subject subject
- #:text text)))
+ (catch #t
+ (lambda ()
+ (send-email server
+ #:from from
+ #:to to
+ #:subject subject
+ #:text text))
+ (lambda args
+ (log-message "Failed to send the email notification: ~a."
+ args)))))
(define (notification-mastodon notification)
"Send a new status for the given NOTIFICATION."
(let ((text (notification-text notification)))
- (send-status text)))
+ (catch #t
+ (lambda ()
+ (send-status text))
+ (lambda args
+ (log-message "Failed to send the mastodon notification: ~a."
+ args)))))
(define* (send-notifications notifications #:key build)
"Send the notifications in NOTIFICATIONS list, regarding the given BUILD."