Improve error handling for processing emails
This commit is contained in:
parent
84ad3656df
commit
d35cc85d52
1 changed files with 20 additions and 4 deletions
|
|
@ -31,7 +31,23 @@
|
||||||
(with-postgresql-connection
|
(with-postgresql-connection
|
||||||
"process-branch-updated-email"
|
"process-branch-updated-email"
|
||||||
(lambda (conn)
|
(lambda (conn)
|
||||||
(enqueue-job-for-email
|
(let* ((email-string
|
||||||
conn
|
(get-string-all (current-input-port)))
|
||||||
(parse-email
|
(email
|
||||||
(get-string-all (current-input-port))))))
|
(catch
|
||||||
|
#t
|
||||||
|
(lambda ()
|
||||||
|
(parse-email email-string))
|
||||||
|
(lambda (key . args)
|
||||||
|
(display "\nerror: while processing email\n"
|
||||||
|
(current-error-port))
|
||||||
|
(simple-format (current-error-port)
|
||||||
|
"~A: ~A\n\n"
|
||||||
|
key
|
||||||
|
args)
|
||||||
|
(display email-string (current-error-port))
|
||||||
|
(display "\n\n" (current-error-port))
|
||||||
|
#f))))
|
||||||
|
(when email
|
||||||
|
(enqueue-job-for-email conn email)))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue