From b69cde97ab2b149d5f45211a42e0f1fd5f5c7ce2 Mon Sep 17 00:00:00 2001 From: Kevin Fox Date: Tue, 4 Oct 2016 11:28:19 -0400 Subject: [PATCH] Update zendesk.py Throw a ZendeskError when the request fails --- zendesk/zendesk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zendesk/zendesk.py b/zendesk/zendesk.py index afd4cb5..7516f25 100755 --- a/zendesk/zendesk.py +++ b/zendesk/zendesk.py @@ -240,7 +240,7 @@ def _response_handler(response, content): the body of 'content' has our response. """ if response.status >= 400: - return responses[response.status] + raise ZendeskError(content, response.status) # Deserialize json content if content exist. In some cases Zendesk # returns ' ' strings. Also return false non strings (0, [], (), {})