Skip to content

Commit

Permalink
fix get method
Browse files Browse the repository at this point in the history
  • Loading branch information
laura.panzariello committed Aug 23, 2018
1 parent 29a97f4 commit 3387cba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions networkapiclient/ApiGenericClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ def get(self, uri):

request.raise_for_status()

return request.json()
try:
return request.json()
except:
return request

except HTTPError:
error = request.json()
error = request
self.logger.error(error)
raise NetworkAPIClientError(error.get('detail', ''))
raise NetworkAPIClientError(str(error))
finally:
self.logger.info('URI: %s', uri)
if request:
Expand Down

0 comments on commit 3387cba

Please sign in to comment.