Skip to content

Commit

Permalink
raise the exception properly
Browse files Browse the repository at this point in the history
  • Loading branch information
meln1k committed Oct 26, 2023
1 parent 265846e commit 3ff9269
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fixcloudutils/redis/event_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,9 @@ async def _listen(self) -> None:
await self._handle_stream_messages_parallel(messages, self.parallelism)
else:
await self._handle_stream_messages(messages)
except RuntimeError as r:
if len(r.args) > 0 and r.args[0] == "no running event loop":
raise r
except Exception as e:
if isinstance(e, RuntimeError) and len(e.args) and e.args[0] == "no running event loop":
raise e
log.error(f"Failed to read from stream {self.stream}: {e}", exc_info=True)
if self.stop_on_fail:
raise
Expand Down

0 comments on commit 3ff9269

Please sign in to comment.