Skip to content

Commit

Permalink
refactor: use assert statement instead of raising an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
maxalbert committed Jun 20, 2024
1 parent 3e90aa4 commit 0c2447a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions faststream/nats/broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,6 @@ async def new_inbox(self) -> str:
[1] https://nats-io.github.io/nats.py/modules.html#nats.aio.client.Client.new_inbox
"""
if not self._connection:
raise RuntimeError("Broker needs to be started before calling this method.")
assert self._connection # nosec B101

return self._connection.new_inbox()

0 comments on commit 0c2447a

Please sign in to comment.