emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mastodon 5e31b1b484 15/27: http: some hack error handling


From: ELPA Syncer
Subject: [nongnu] elpa/mastodon 5e31b1b484 15/27: http: some hack error handling in get-response
Date: Fri, 23 Feb 2024 13:00:55 -0500 (EST)

branch: elpa/mastodon
commit 5e31b1b484736b771b58a5d153b7e6e8f22cb364
Author: marty hiatt <martianhiatus@riseup.net>
Commit: marty hiatt <martianhiatus@riseup.net>

    http: some hack error handling in get-response
---
 lisp/mastodon-http.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 541c92e66f..a345324ca5 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]