aboutsummaryrefslogtreecommitdiff
path: root/stack-core.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-10-31 00:06:31 -0400
committerSean Allred <code@seanallred.com>2014-10-31 00:06:31 -0400
commit1838aeb531ab61e2c333c70fbf57d534df54fc47 (patch)
tree80c2d817944998e1e8a2a73118fa602a20bd8cc0 /stack-core.el
parentc126f042a5d8599730dc081a0d17104a3f603891 (diff)
Throw an error when we receive one from the API
Diffstat (limited to 'stack-core.el')
-rw-r--r--stack-core.el6
1 files changed, 6 insertions, 0 deletions
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