Skip to content

Commit

Permalink
Merge pull request #17 from ricco386/JSONDecodeError
Browse files Browse the repository at this point in the history
Raise HTTPException if response not `20x`
  • Loading branch information
veox authored May 26, 2017
2 parents e44ec33 + b63d975 commit 10a2b1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ Changed
^^^^^^^
* Renamed ``NEWS`` to ``CHANGELOG``.

[v0.1.5a] - Unreleased (Anyday)
------------------------------

Added
^^^^^
* Updated kraken connection to raise error in case it doesnt receive 20x status code.


[v0.1.4] - 2017-03-27 (Monday)
------------------------------

Expand Down
3 changes: 3 additions & 0 deletions krakenex/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ def _request(self, url, req={}, headers={}):
self.conn.request('POST', url, data, headers)
response = self.conn.getresponse()

if response.status not in (200, 201, 202):
raise http.client.HTTPException(response.status)

return response.read().decode()

0 comments on commit 10a2b1b

Please sign in to comment.