File tree Expand file tree Collapse file tree 3 files changed +4
-46
lines changed
Expand file tree Collapse file tree 3 files changed +4
-46
lines changed Original file line number Diff line number Diff line change @@ -692,36 +692,4 @@ export class Client {
692692 public get rustClient ( ) : bridge . RustClient {
693693 return this . #rustClient;
694694 }
695-
696- public handleBridgeError = async ( error : Error ) : Promise < void > => {
697- const [ reconnect , nextEndpoint ] = this . shouldReconnect ( error ) ;
698-
699- if ( ! reconnect ) return ;
700-
701- debug . connection ( "Got bridge reconnection error" , error . message ) ;
702-
703- const currentChannel = await this . #channel;
704- if ( ! currentChannel ) {
705- debug . connection ( "No channel to reconnect" ) ;
706- return ;
707- }
708-
709- debug . connection (
710- `Reconnection required${ nextEndpoint ? ` to: ${ nextEndpoint } ` : "" } `
711- ) ;
712-
713- const [ _protocol , address , port ] = currentChannel . getTarget ( ) . split ( ":" ) ;
714-
715- currentChannel . close ( ) ;
716- this . #grpcClients. clear ( ) ;
717- this . #channel = undefined ;
718- this . #serverFeatures = undefined ;
719- this . #nextChannelSettings = {
720- failedEndpoint : {
721- address,
722- port : Number . parseInt ( port ) ,
723- } ,
724- nextEndpoint,
725- } ;
726- } ;
727695}
Original file line number Diff line number Diff line change @@ -78,12 +78,9 @@ Client.prototype.readAll = function (
7878 try {
7979 stream = this . rustClient . readAll ( options ) ;
8080 } catch ( error ) {
81- const bridgeError = convertBridgeError ( error ) ;
82- this . handleBridgeError ( bridgeError ) ;
83- throw bridgeError ;
81+ throw convertBridgeError ( error ) ;
8482 }
8583
86- const handleBridgeError = this . handleBridgeError ;
8784 const convert = async function * (
8885 stream : AsyncIterable < bridge . ResolvedEvent [ ] >
8986 ) {
@@ -94,9 +91,7 @@ Client.prototype.readAll = function (
9491 }
9592 }
9693 } catch ( error ) {
97- const bridgeError = convertBridgeError ( error ) ;
98- await handleBridgeError ( bridgeError ) ;
99- throw bridgeError ;
94+ throw convertBridgeError ( error ) ;
10095 }
10196 } ;
10297
Original file line number Diff line number Diff line change @@ -108,12 +108,9 @@ Client.prototype.readStream = function <
108108 try {
109109 stream = this . rustClient . readStream ( streamName , options ) ;
110110 } catch ( error ) {
111- const bridgeError = convertBridgeError ( error , streamName ) ;
112- this . handleBridgeError ( bridgeError ) ;
113- throw bridgeError ;
111+ throw convertBridgeError ( error , streamName ) ;
114112 }
115113
116- const handleBridgeError = this . handleBridgeError ;
117114 const convert = async function * (
118115 stream : AsyncIterable < bridge . ResolvedEvent [ ] >
119116 ) {
@@ -124,9 +121,7 @@ Client.prototype.readStream = function <
124121 }
125122 }
126123 } catch ( error ) {
127- const bridgeError = convertBridgeError ( error , streamName ) ;
128- await handleBridgeError ( bridgeError ) ;
129- throw bridgeError ;
124+ throw convertBridgeError ( error , streamName ) ;
130125 }
131126 } ;
132127
You can’t perform that action at this time.
0 commit comments