diff options
author | Sean Allred <code@seanallred.com> | 2014-10-31 00:06:31 -0400 |
---|---|---|
committer | Sean Allred <code@seanallred.com> | 2014-10-31 00:06:31 -0400 |
commit | 1838aeb531ab61e2c333c70fbf57d534df54fc47 (patch) | |
tree | 80c2d817944998e1e8a2a73118fa602a20bd8cc0 | |
parent | c126f042a5d8599730dc081a0d17104a3f603891 (diff) |
Throw an error when we receive one from the API
-rw-r--r-- | stack-core.el | 6 |
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 |