Skip to content

Commit

Permalink
fix: raise error if new_inbox() is called before broker was started
Browse files Browse the repository at this point in the history
  • Loading branch information
maxalbert committed Jun 20, 2024
1 parent 7b92dd1 commit 3e90aa4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions faststream/nats/broker/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,4 +909,7 @@ 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.")

return self._connection.new_inbox()

0 comments on commit 3e90aa4

Please sign in to comment.