From 1838aeb531ab61e2c333c70fbf57d534df54fc47 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 31 Oct 2014 00:06:31 -0400 Subject: Throw an error when we receive one from the API --- stack-core.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'stack-core.el') diff --git a/stack-core.el b/stack-core.el index 7b86de1..294bce1 100644 --- a/stack-core.el +++ b/stack-core.el @@ -167,6 +167,12 @@ entire response as a complex alist." (error "Response corrupted") (delete-region (point-min) (point)) (buffer-string))))))) + (when (assoc 'error_id response) + (error "Request failed: (%s) [%i %s] %s" + method + (cdr (assoc 'error_id response)) + (cdr (assoc 'error_name response)) + (cdr (assoc 'error_message response)))) (setq stack-core-remaining-api-requests (cdr (assoc 'quota_remaining response))) (when (< stack-core-remaining-api-requests -- cgit v1.2.3