We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8a06e15 commit 05e8d17Copy full SHA for 05e8d17
nodejs/src/client/wsConnectionManager.ts
@@ -389,10 +389,14 @@ export class ConnectionManager {
389
throw new WebSocketQueryError(result.msg.code, result.msg.message);
390
}
391
} catch (e: any) {
392
- // Auth failure — don't retry this host
+ // If it's already a WebSocketQueryError, preserve the original error
393
+ if (e instanceof WebSocketQueryError) {
394
+ throw e;
395
+ }
396
+ // For other errors, wrap as authentication failure
397
throw new TDWebSocketClientError(
398
ErrorCode.ERR_WEBSOCKET_CONNECTION_FAIL,
- `Authentication failed: ${e.message}`
399
+ `Authentication failed: ${e.message || e}`
400
);
401
402
0 commit comments