From e69b3624740260484b7bc25f9ba27461a19748af Mon Sep 17 00:00:00 2001 From: anilkumar Date: Sat, 16 Aug 2025 01:23:25 +0530 Subject: [PATCH] fix: prevent onerror from firing twice when client.close() is called --- src/client/streamableHttp.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/streamableHttp.ts b/src/client/streamableHttp.ts index 12714ea4..88e6b232 100644 --- a/src/client/streamableHttp.ts +++ b/src/client/streamableHttp.ts @@ -233,8 +233,7 @@ export class StreamableHTTPClientTransport implements Transport { this._handleSseStream(response.body, options, true); } catch (error) { - this.onerror?.(error as Error); - throw error; + throw error as Error; } }