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 branch-updated-emails))
|
||||
|
||||
|
|
@ -35,20 +36,17 @@
|
|||
(lambda (conn)
|
||||
(let* ((email-bytevector
|
||||
(get-bytevector-all (current-input-port))))
|
||||
(catch
|
||||
#t
|
||||
(with-exception-handler
|
||||
(lambda _ #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))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue