From 9a58f5223fad6ccb067dcb7303d7f5f559a1b9b5 Mon Sep 17 00:00:00 2001 From: Francesco Ceccon Date: Wed, 18 Jan 2023 11:22:42 +0000 Subject: [PATCH] protocol: rethrow error if not reconnecting --- .changeset/proud-clocks-live.md | 5 +++++ packages/protocol/src/client.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/proud-clocks-live.md diff --git a/.changeset/proud-clocks-live.md b/.changeset/proud-clocks-live.md new file mode 100644 index 0000000..a914112 --- /dev/null +++ b/.changeset/proud-clocks-live.md @@ -0,0 +1,5 @@ +--- +'@apibara/protocol': patch +--- + +Rethrow error if not reconnecting diff --git a/packages/protocol/src/client.ts b/packages/protocol/src/client.ts index b12fc78..7119479 100644 --- a/packages/protocol/src/client.ts +++ b/packages/protocol/src/client.ts @@ -178,7 +178,7 @@ export class StreamClient { const { reconnect, args } = await Promise.resolve(this.onReconnect(err, retryCount)) retryCount += 1 if (!reconnect) { - break + throw err } this.connect()