From 0c5139649cfd1698049a06b7cbcdabba4c95e17a Mon Sep 17 00:00:00 2001 From: mousebot Date: Mon, 7 Jun 2021 20:43:18 +0200 Subject: attempt to handle response errors in mastodon-http--process-json --- lisp/mastodon-http.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el index cb211d4..144b446 100644 --- a/lisp/mastodon-http.el +++ b/lisp/mastodon-http.el @@ -126,7 +126,9 @@ Pass response buffer to CALLBACK function." (buffer-substring-no-properties (point) (point-max)) 'utf-8))) (kill-buffer) - (json-read-from-string json-string))) + (if (not (or (string= "" json-string) (equal nil json-string))) + (json-read-from-string json-string) + (message "Looks like we got no JSON from the server.")))) (defun mastodon-http--delete (url) "Make DELETE request to URL." -- cgit v1.2.3