aboutsummaryrefslogtreecommitdiff
path: root/web/webserver.scm
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-10-31 10:30:40 -0500
committerFrederick Muriuki Muriithi2024-10-31 10:30:40 -0500
commit9b3a2172c63578bf7ca6224da10be5ad951a2de1 (patch)
tree97b1249fe3529fa94de78d72420833f4fecd38fa /web/webserver.scm
parentd73c86f61ca6d48b41e9d608000ff62d3c3ad995 (diff)
downloadgn-guile-9b3a2172c63578bf7ca6224da10be5ad951a2de1.tar.gz
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.
Diffstat (limited to 'web/webserver.scm')
-rw-r--r--web/webserver.scm4
1 files 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))