Skip to content
Prev Previous commit
Next Next commit
Aiohttp response status code
  • Loading branch information
annatisch committed Jul 25, 2019
commit 106394773ccb84e4fbeb443ff63c30db6ea00ebf
5 changes: 4 additions & 1 deletion sdk/core/azure-core/azure/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def __init__(self, message=None, response=None, **kwargs):
self.response = response
if response:
self.reason = response.reason
self.status_code = response.status_code
try:
self.status_code = response.status_code # Requests
except AttributeError:
self.status_code = response.status # Aiohttp
message = message or "Operation returned an invalid status '{}'".format(self.reason)
try:
try:
Expand Down