Skip to content

Commit

Permalink
HTTP response is part of InfluxException now.
Browse files Browse the repository at this point in the history
  • Loading branch information
puentesarrin committed Jan 2, 2015
1 parent c805662 commit 422299d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion asyncflux/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def request(self, path, path_params={}, qs={}, body=None, method='GET'):
if hasattr(response, 'body') and response.body:
raise gen.Return(self.__json.loads(response.body))
except httpclient.HTTPError as e:
raise InfluxException(e.response.body)
raise InfluxException(e.response)

@asyncflux_coroutine
def get_databases(self):
Expand Down
6 changes: 5 additions & 1 deletion asyncflux/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@


class InfluxException(Exception):
pass

def __init__(self, http_response):
self.response = http_response
self.message = http_response.body
super(InfluxException, self).__init__(self.message)


def asyncflux_coroutine(f):
Expand Down

0 comments on commit 422299d

Please sign in to comment.