diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-02-20 09:52:02 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-02-20 09:52:02 +0100 |
commit | 5e31b1b484736b771b58a5d153b7e6e8f22cb364 (patch) | |
tree | 2666d83d4a5e3330f48c2da7c2035136fce44ef3 | |
parent | af029656fae2b54ea26467423dab7090d170d0a5 (diff) |
http: some hack error handling in get-response
-rw-r--r-- | lisp/mastodon-http.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index 541c92e..a345324 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -179,8 +179,14 @@ PARAMS is an alist of any extra parameters to send with the request. SILENT means don't message. NO-HEADERS means don't collect http response headers. VECTOR means return json arrays as vectors." - (with-current-buffer (mastodon-http--get url params silent) - (mastodon-http--process-response no-headers vector))) + (let ((buf (mastodon-http--get url params silent))) + ;; (if (not buf) + ;; (error "Request returned nada") + (condition-case x + (with-current-buffer buf + (mastodon-http--process-response no-headers vector)) + (wrong-type-argument + (error "Request returned nada"))))) (defun mastodon-http--get-json (url &optional params silent vector) "Return only JSON data from URL request. |