Skip to content

Commit bb9eef8

Browse files
fix(client): suppress SSE-disconnect onerror when abort came from intentional close()
1 parent 7ce0a21 commit bb9eef8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/client/src/client/streamableHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ export class StreamableHTTPClientTransport implements Transport {
474474
} catch (error) {
475475
this.onerror?.(new Error(`Failed to reconnect: ${error instanceof Error ? error.message : String(error)}`));
476476
}
477-
} else {
477+
} else if (!this._abortController?.signal.aborted) {
478478
// Stream disconnected and reconnection will not happen; surface the error
479479
this.onerror?.(new Error(`SSE stream disconnected: ${error instanceof Error ? error.message : String(error)}`));
480480
}

0 commit comments

Comments
 (0)