aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-http.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-http.el')
-rw-r--r--lisp/mastodon-http.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 60654ff..d6abac4 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -187,9 +187,13 @@ 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."
- (let ((buf (mastodon-http--get url params silent)))
+(let ((buf (mastodon-http--get url params silent)))
+ ;; --get can return nil if instance unresponsive:
+ (if (not buf)
+ (user-error "Looks like the server response borked. \
+Is your instance up?")
(with-current-buffer buf
- (mastodon-http--process-response no-headers vector))))
+ (mastodon-http--process-response no-headers vector)))))
(defun mastodon-http--get-json (url &optional params silent vector)
"Return only JSON data from URL request.