File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,11 @@ export class StreamableHTTPServerTransport implements Transport {
303303 res . on ( "close" , ( ) => {
304304 this . _streamMapping . delete ( this . _standaloneSseStreamId ) ;
305305 } ) ;
306+
307+ // Add error handler for standalone SSE stream
308+ res . on ( "error" , ( error ) => {
309+ this . onerror ?.( error as Error ) ;
310+ } ) ;
306311 }
307312
308313 /**
@@ -334,6 +339,11 @@ export class StreamableHTTPServerTransport implements Transport {
334339 }
335340 } ) ;
336341 this . _streamMapping . set ( streamId , res ) ;
342+
343+ // Add error handler for replay stream
344+ res . on ( "error" , ( error ) => {
345+ this . onerror ?.( error as Error ) ;
346+ } ) ;
337347 } catch ( error ) {
338348 this . onerror ?.( error as Error ) ;
339349 }
@@ -520,6 +530,11 @@ export class StreamableHTTPServerTransport implements Transport {
520530 this . _streamMapping . delete ( streamId ) ;
521531 } ) ;
522532
533+ // Add error handler for stream write errors
534+ res . on ( "error" , ( error ) => {
535+ this . onerror ?.( error as Error ) ;
536+ } ) ;
537+
523538 // handle each message
524539 for ( const message of messages ) {
525540 this . onmessage ?.( message , { authInfo, requestInfo } ) ;
You can’t perform that action at this time.
0 commit comments