fix: improve error handling for connection-related issues

This commit is contained in:
Pranav C
2026-01-23 06:31:04 +00:00
parent 9d2807d8b5
commit 438d9eeeb7

View File

@@ -99,7 +99,10 @@ export function isTransientError(error: any): boolean {
// 4. Check error message for specific connection-related patterns
// Note: Using specific phrases to minimize false positives
const errorMessage = error?.message?.toLowerCase() || '';
// Handle both error objects with .message property and plain strings
const errorMessage = (
typeof error === 'string' ? error : error?.message || ''
).toLowerCase();
// Only check messages with reasonable length to avoid matching generic errors
if (errorMessage.length > 20) {