File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1241,8 +1241,18 @@ ${await this.suggestRule(request)}`
12411241 } ) ;
12421242 }
12431243
1244- socket . on ( 'error' , ( ) => upstreamSocket . destroy ( ) ) ;
1245- upstreamSocket . on ( 'error' , ( ) => socket . destroy ( ) ) ;
1244+ socket . on ( 'error' , ( e : any ) => {
1245+ if ( this . debug ) console . warn ( `Downstream ${ type } passthrough error to ${ hostname } :${ targetPort } :` , e ) ;
1246+ eventData . tags . push ( `${ type } -passthrough-error:${ e . code || 'UNKNOWN' } ` ) ;
1247+ upstreamSocket . destroy ( ) ;
1248+ } ) ;
1249+
1250+ upstreamSocket . on ( 'error' , ( e ) => {
1251+ if ( this . debug ) console . warn ( `Upstream ${ type } passthrough error to ${ hostname } :${ targetPort } :` , e ) ;
1252+ eventData . tags . push ( `${ type } -passthrough-error:${ e . code || 'UNKNOWN' } ` ) ;
1253+ socket . destroy ( )
1254+ } ) ;
1255+
12461256 upstreamSocket . on ( 'close' , ( ) => socket . destroy ( ) ) ;
12471257 socket . on ( 'close' , ( ) => {
12481258 upstreamSocket . destroy ( ) ;
You can’t perform that action at this time.
0 commit comments