Use with-exception-handler in place of with-throw-handler
This commit is contained in:
parent
1da2a09cfb
commit
e591346684
7 changed files with 109 additions and 98 deletions
|
|
@ -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))
|
||||
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue