diff options
Diffstat (limited to 'sx-request.el')
-rw-r--r-- | sx-request.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sx-request.el b/sx-request.el index e91ac18..f892367 100644 --- a/sx-request.el +++ b/sx-request.el @@ -131,6 +131,8 @@ access the response wrapper." (vconcat return-value (cdr (assoc 'items response))))) +;;; NOTE: Whenever this is arglist changes, `sx-request-fallback' must +;;; also change. (defun sx-request-make (method &optional args request-method process-function) "Make a request to the API, executing METHOD with ARGS. You should almost certainly be using `sx-method-call' instead of @@ -189,6 +191,7 @@ the main content of the response is returned." ;; RESPONSE to 'corrupt or something (response (with-demoted-errors "`json' error: %S" (json-read-from-string data)))) + (kill-buffer response-buffer) (when (and (not response) (string-equal data "{}")) (sx-message "Unable to parse response: %S" response) (error "Response could not be read by `json-read-from-string'")) @@ -204,7 +207,7 @@ the main content of the response is returned." (funcall (or process-function #'sx-request-response-get-items) response))))))) -(defun sx-request-fallback (_method &optional _args _request-method) +(defun sx-request-fallback (_method &optional _args _request-method _process-function) "Fallback method when authentication is not available. This is for UI generation when the associated API call would require authentication. |