1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-18 04:22:21 +00:00

Improved docs and client

* Client now raises an exception on error
* Added conversion to the documentation
This commit is contained in:
J. Fernando Sánchez
2017-02-28 19:38:01 +01:00
parent 97bd245dfc
commit a0ff528a4b
6 changed files with 186 additions and 78 deletions

View File

@@ -18,7 +18,6 @@ class Client(object):
try:
resp = models.from_dict(response.json())
resp.validate(resp)
return resp
except Exception as ex:
logger.error(('There seems to be a problem with the response:\n'
'\tURL: {url}\n'
@@ -33,3 +32,6 @@ class Client(object):
code=response.status_code,
content=response.content))
raise ex
if isinstance(resp, models.Error):
raise resp
return resp