File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -637,7 +637,15 @@ export class Http2CallStream implements Call {
637
637
this . pendingWrite . length +
638
638
' (deferred)'
639
639
) ;
640
- stream . write ( this . pendingWrite , this . pendingWriteCallback ) ;
640
+ try {
641
+ stream . write ( this . pendingWrite , this . pendingWriteCallback ) ;
642
+ } catch ( error ) {
643
+ this . endCall ( {
644
+ code : Status . UNAVAILABLE ,
645
+ details : `Write failed with error ${ error . message } ` ,
646
+ metadata : new Metadata ( )
647
+ } ) ;
648
+ }
641
649
}
642
650
this . maybeCloseWrites ( ) ;
643
651
}
@@ -762,7 +770,15 @@ export class Http2CallStream implements Call {
762
770
this . pendingWriteCallback = cb ;
763
771
} else {
764
772
this . trace ( 'sending data chunk of length ' + message . message . length ) ;
765
- this . http2Stream . write ( message . message , cb ) ;
773
+ try {
774
+ this . http2Stream . write ( message . message , cb ) ;
775
+ } catch ( error ) {
776
+ this . endCall ( {
777
+ code : Status . UNAVAILABLE ,
778
+ details : `Write failed with error ${ error . message } ` ,
779
+ metadata : new Metadata ( )
780
+ } ) ;
781
+ }
766
782
this . maybeCloseWrites ( ) ;
767
783
}
768
784
} , this . handleFilterError . bind ( this ) ) ;
You can’t perform that action at this time.
0 commit comments