Skip to content

Commit 737c5f9

Browse files
authored
Fixed bug in error handling (Azure#100)
1 parent 9217139 commit 737c5f9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

azure/eventhub/async_ops/receiver_async.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ async def _reconnect_async(self): # pylint: disable=too-many-statements
159159
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
160160
log.info("AsyncReceiver couldn't authenticate. Attempting reconnect.")
161161
return False
162-
log.info("AsyncReceiver connection error (%r). Shutting down.", e)
163-
error = EventHubError(str(shutdown), shutdown)
162+
log.info("AsyncReceiver connection error (%r). Shutting down.", shutdown)
163+
error = EventHubError(str(shutdown))
164164
await self.close_async(exception=error)
165165
raise error
166166
except Exception as e:

azure/eventhub/async_ops/sender_async.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ async def _reconnect_async(self):
144144
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
145145
log.info("AsyncSender couldn't authenticate. Attempting reconnect.")
146146
return False
147-
log.info("AsyncSender connection error (%r). Shutting down.", e)
148-
error = EventHubError(str(shutdown), shutdown)
147+
log.info("AsyncSender connection error (%r). Shutting down.", shutdown)
148+
error = EventHubError(str(shutdown))
149149
await self.close_async(exception=error)
150150
raise error
151151
except Exception as e:

azure/eventhub/receiver.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _reconnect(self): # pylint: disable=too-many-statements
154154
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
155155
log.info("Receiver couldn't authenticate. Attempting reconnect.")
156156
return False
157-
log.info("Receiver connection error (%r). Shutting down.", e)
157+
log.info("Receiver connection error (%r). Shutting down.", shutdown)
158158
error = EventHubError(str(shutdown))
159159
self.close(exception=error)
160160
raise error

azure/eventhub/sender.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _reconnect(self):
137137
if str(shutdown).startswith("Unable to open authentication session") and self.auto_reconnect:
138138
log.info("Sender couldn't authenticate. Attempting reconnect.")
139139
return False
140-
log.info("Sender connection error (%r). Shutting down.", e)
140+
log.info("Sender connection error (%r). Shutting down.", shutdown)
141141
error = EventHubError(str(shutdown))
142142
self.close(exception=error)
143143
raise error

0 commit comments

Comments
 (0)