aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator/client-communication.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix-build-coordinator/client-communication.scm')
-rw-r--r--guix-build-coordinator/client-communication.scm30
1 files changed, 12 insertions, 18 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm
index 580773b..4fdfade 100644
--- a/guix-build-coordinator/client-communication.scm
+++ b/guix-build-coordinator/client-communication.scm
@@ -380,27 +380,21 @@
(with-exception-handler
(lambda (exn)
- (match method-and-path-components
- ((method path-components ...)
- (simple-format
- (current-error-port)
- "error: when processing client request: /~A ~A\n ~A"
- method (string-join path-components "/")
- exn)))
(render-json
- `((error . ,(simple-format #f "~A" exn)))
+ `((error . 500))
#:code 500))
(lambda ()
- (with-exception-handler
- (lambda (exn)
- (catch #t
- (lambda ()
- (backtrace))
- (lambda (key . args)
- (simple-format (current-error-port)
- "error: guile crashed printing backtrace\n")))
- (raise-exception exn))
- controller-thunk))
+ (with-throw-handler #t
+ controller-thunk
+ (lambda (key . args)
+ (match method-and-path-components
+ ((method path-components ...)
+ (simple-format
+ (current-error-port)
+ "error: when processing client request: /~A ~A\n ~A ~A\n"
+ method (string-join path-components "/")
+ key args)))
+ (backtrace))))
#:unwind? #t))
(define* (render-json json #:key (extra-headers '())