File tree Expand file tree Collapse file tree
packages/lattice-client-core/src/connection Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ class NatsWsLatticeConnection implements LatticeConnection<Options> {
9090 subject : string ,
9191 data ?: Uint8Array | string | undefined ,
9292 ) : Promise < Response > {
93- const maxRetries = this . #options. retryCount ?? 3 ;
93+ const maxRetries = this . #options. retryCount ?? 0 ;
9494 let lastError : Error | undefined ;
9595
9696 for ( let attempt = 0 ; attempt <= maxRetries ; attempt ++ ) {
@@ -99,10 +99,7 @@ class NatsWsLatticeConnection implements LatticeConnection<Options> {
9999 const response = await connection . request ( subject , data ) ;
100100 return response . json < Response > ( ) ;
101101 } catch ( error ) {
102- lastError =
103- error instanceof Error
104- ? error
105- : new Error ( error instanceof Error ? error . message : 'Unknown error' ) ;
102+ lastError = error instanceof Error ? error : new Error ( String ( error ) ) ;
106103
107104 // Don't retry on the last attempt
108105 if ( attempt < maxRetries ) {
You can’t perform that action at this time.
0 commit comments