From 9b3a2172c63578bf7ca6224da10be5ad951a2de1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 31 Oct 2024 10:30:40 -0500 Subject: Make error details into list of cons cells If the details are not cons cells, then the `json-build-object` bails with the error: In procedure car: Wrong type argument in position 1 (expecting pair): file-error This fixes that and allows a cleaner response. --- web/webserver.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/webserver.scm b/web/webserver.scm index d4044a8..c13397e 100644 --- a/web/webserver.scm +++ b/web/webserver.scm @@ -172,8 +172,8 @@ otherwise search for set/group data" (lambda (key . args) (let ((msg (car args))) (build-json-response 400 - `(("error" ,key) - ("msg" ,msg))))))) + `(("error" . ,key) + ("msg" . ,msg))))))) (define (invalid-data? data target) (if (string? (assoc-ref data target)) -- cgit v1.2.3