diff options
author | Frederick Muriuki Muriithi | 2024-10-31 10:30:40 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-10-31 10:30:40 -0500 |
commit | 9b3a2172c63578bf7ca6224da10be5ad951a2de1 (patch) | |
tree | 97b1249fe3529fa94de78d72420833f4fecd38fa /web | |
parent | d73c86f61ca6d48b41e9d608000ff62d3c3ad995 (diff) | |
download | gn-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')
-rw-r--r-- | web/webserver.scm | 4 |
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)) |