aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2025-03-11 10:16:51 +0000
committerChristopher Baines <mail@cbaines.net>2025-03-11 10:16:51 +0000
commit83fed1d9adf703824d9b715476c747f32bb21f88 (patch)
tree50a3248121273e6e579caff11d721591955774b3
parent250c14f966ffc14170f03a62900b6946b1697342 (diff)
downloadqa-frontpage-83fed1d9adf703824d9b715476c747f32bb21f88.tar
qa-frontpage-83fed1d9adf703824d9b715476c747f32bb21f88.tar.gz
Stop using the knots web-server exception handler
As I want to remove it.
-rw-r--r--guix-qa-frontpage/server.scm37
1 files changed, 28 insertions, 9 deletions
diff --git a/guix-qa-frontpage/server.scm b/guix-qa-frontpage/server.scm
index 0639f19..2f70a6a 100644
--- a/guix-qa-frontpage/server.scm
+++ b/guix-qa-frontpage/server.scm
@@ -953,15 +953,34 @@ Disallow: /issue
(run-knots-web-server
(lambda (request)
- (apply values (handler request
- (read-request-body request)
- controller)))
- #:exception-handler
- (lambda (exn request)
- (default-exception-handler exn request)
- (apply values
- (render-html #:sxml (error-page exn)
- #:code 500)))
+ (with-exception-handler
+ (lambda (exn)
+ (apply values
+ (render-html #:sxml (error-page exn)
+ #:code 500)))
+ (lambda ()
+ (with-exception-handler
+ (lambda (exn)
+ (let* ((error-string
+ (call-with-output-string
+ (lambda (port)
+ (simple-format
+ port
+ "exception when processing: ~A ~A\n"
+ (request-method request)
+ (uri-path (request-uri request)))
+ (print-backtrace-and-exception/knots
+ exn
+ #:port port)))))
+ (display error-string
+ (current-error-port)))
+
+ (raise-exception exn))
+ (lambda ()
+ (apply values (handler request
+ (read-request-body request)
+ controller)))))
+ #:unwind? #t))
#:host host
#:port port)