Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Fixed bug in error handling (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
annatisch authored Mar 3, 2019
1 parent 9217139 commit 737c5f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions azure/eventhub/async_ops/receiver_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ async def _reconnect_async(self): # pylint: disable=too-many-statements
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
log.info("AsyncReceiver couldn't authenticate. Attempting reconnect.")
return False
log.info("AsyncReceiver connection error (%r). Shutting down.", e)
error = EventHubError(str(shutdown), shutdown)
log.info("AsyncReceiver connection error (%r). Shutting down.", shutdown)
error = EventHubError(str(shutdown))
await self.close_async(exception=error)
raise error
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions azure/eventhub/async_ops/sender_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ async def _reconnect_async(self):
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
log.info("AsyncSender couldn't authenticate. Attempting reconnect.")
return False
log.info("AsyncSender connection error (%r). Shutting down.", e)
error = EventHubError(str(shutdown), shutdown)
log.info("AsyncSender connection error (%r). Shutting down.", shutdown)
error = EventHubError(str(shutdown))
await self.close_async(exception=error)
raise error
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion azure/eventhub/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _reconnect(self): # pylint: disable=too-many-statements
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
log.info("Receiver couldn't authenticate. Attempting reconnect.")
return False
log.info("Receiver connection error (%r). Shutting down.", e)
log.info("Receiver connection error (%r). Shutting down.", shutdown)
error = EventHubError(str(shutdown))
self.close(exception=error)
raise error
Expand Down
2 changes: 1 addition & 1 deletion azure/eventhub/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def _reconnect(self):
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
log.info("Sender couldn't authenticate. Attempting reconnect.")
return False
log.info("Sender connection error (%r). Shutting down.", e)
log.info("Sender connection error (%r). Shutting down.", shutdown)
error = EventHubError(str(shutdown))
self.close(exception=error)
raise error
Expand Down

0 comments on commit 737c5f9

Please sign in to comment.