From 699cf97206ffb912a13b7364f8acd916214eaff8 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 3 Sep 2024 22:50:55 +0100 Subject: [PATCH] improve tangc http error messages --- pkgs/tangc/tangc.fnl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/tangc/tangc.fnl b/pkgs/tangc/tangc.fnl index 6a1d6dc..f0f6a0a 100644 --- a/pkgs/tangc/tangc.fnl +++ b/pkgs/tangc/tangc.fnl @@ -102,19 +102,19 @@ (fn http-post [url body] (match - (http.request "POST" url - "" 0 - "application/x-www-form-urlencoded" - body) - s (json.decode s) - (nil err) (error err))) + (http.request "POST" url + "" 0 + "application/x-www-form-urlencoded" + body) + s (json.decode s) + (nil code msg) (error (.. "Error " code " POST " url ": " msg)))) (fn http-get [url body] (match - (http.fetch url) - s (json.decode s) - (nil code msg) (error (.. "Error: " code ": " msg)))) + (http.fetch url) + s (json.decode s) + (nil code msg) (error (.. "Error " code " GET " url ": " msg)))) (fn decrypt [] (let [b64 (base64 :url)