improve tangc http error messages
This commit is contained in:
parent
cd0093279c
commit
699cf97206
@ -102,19 +102,19 @@
|
|||||||
|
|
||||||
(fn http-post [url body]
|
(fn http-post [url body]
|
||||||
(match
|
(match
|
||||||
(http.request "POST" url
|
(http.request "POST" url
|
||||||
"" 0
|
"" 0
|
||||||
"application/x-www-form-urlencoded"
|
"application/x-www-form-urlencoded"
|
||||||
body)
|
body)
|
||||||
s (json.decode s)
|
s (json.decode s)
|
||||||
(nil err) (error err)))
|
(nil code msg) (error (.. "Error " code " POST " url ": " msg))))
|
||||||
|
|
||||||
|
|
||||||
(fn http-get [url body]
|
(fn http-get [url body]
|
||||||
(match
|
(match
|
||||||
(http.fetch url)
|
(http.fetch url)
|
||||||
s (json.decode s)
|
s (json.decode s)
|
||||||
(nil code msg) (error (.. "Error: " code ": " msg))))
|
(nil code msg) (error (.. "Error " code " GET " url ": " msg))))
|
||||||
|
|
||||||
(fn decrypt []
|
(fn decrypt []
|
||||||
(let [b64 (base64 :url)
|
(let [b64 (base64 :url)
|
||||||
|
Loading…
Reference in New Issue
Block a user