diff --git a/nats/src/nats/js/client.py b/nats/src/nats/js/client.py index d516a6e2..576799ca 100644 --- a/nats/src/nats/js/client.py +++ b/nats/src/nats/js/client.py @@ -1231,7 +1231,7 @@ async def _fetch_n( # Return any message that was already available in the internal queue. if msgs: return msgs - raise + raise FetchTimeoutError got_any_response = False @@ -1286,14 +1286,14 @@ async def _fetch_n( # timeout window. deadline = JetStreamContext._time_until(timeout, start_time) if deadline is not None and deadline <= 0: - raise asyncio.TimeoutError + raise FetchTimeoutError next_req = {} next_req["batch"] = needed if deadline is not None: remaining_expires = int(deadline * 1_000_000_000) - 100_000 if remaining_expires <= 0: - raise asyncio.TimeoutError + raise FetchTimeoutError next_req["expires"] = remaining_expires elif expires: next_req["expires"] = expires