aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-data-service-process-branch-updated-mbox.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/guix-data-service-process-branch-updated-mbox.in')
-rw-r--r--scripts/guix-data-service-process-branch-updated-mbox.in27
1 files changed, 13 insertions, 14 deletions
diff --git a/scripts/guix-data-service-process-branch-updated-mbox.in b/scripts/guix-data-service-process-branch-updated-mbox.in
index 0a79f40..5773341 100644
--- a/scripts/guix-data-service-process-branch-updated-mbox.in
+++ b/scripts/guix-data-service-process-branch-updated-mbox.in
@@ -27,6 +27,7 @@
(rnrs bytevectors)
(squee)
(email email)
+ (knots)
(guix-data-service database)
(guix-data-service model git-repository)
(guix-data-service branch-updated-emails))
@@ -36,7 +37,7 @@
(lambda (conn)
(let ((count
(count-git-repositories-with-x-git-repo-header-values conn)))
- (when (eq? count 0)
+ (when (= count 0)
(display
"\nerror: no git_repositories exist with a value for x_git_repo_header
error: to match emails to repositories, the git_repositories entry must have
@@ -52,23 +53,21 @@ a x_git_repo_header value\n"
(for-each
(lambda (email-bytevector)
(display "." (current-error-port))
- (catch
- #t
+ (with-exception-handler
+ (lambda (exn)
+ #f)
(lambda ()
- (with-throw-handler #t
+ (with-exception-handler
+ (lambda (exn)
+ (display "\nerror: while parsing email\n"
+ (current-error-port))
+ (print-backtrace-and-exception/knots exn)
+ (raise-exception exn))
(lambda ()
(enqueue-job-for-email
conn
- (parse-email email-bytevector)))
- (lambda (key . args)
- (display "\nerror: while parsing email\n"
- (current-error-port))
- (simple-format (current-error-port)
- "~A: ~A\n\n"
- key
- args)
- (display-backtrace (make-stack #t) (current-error-port)))))
- (lambda (key . args) #f)))
+ (parse-email email-bytevector)))))
+ #:unwind? #t))
(call-with-input-file file
mbox->emails))