cyberdesk 2.2.5 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -73,20 +73,24 @@ const RETRYABLE_STATUS_CODES = new Set([
|
|
|
73
73
|
]);
|
|
74
74
|
/**
|
|
75
75
|
* Determines if an error is a retryable network error
|
|
76
|
+
*
|
|
77
|
+
* Note: AbortError (from AbortController.abort()) is NOT retried because:
|
|
78
|
+
* - It indicates intentional cancellation by the caller
|
|
79
|
+
* - The abort signal remains aborted, so retries would fail immediately
|
|
80
|
+
* - Retrying would waste attempts and delay error propagation
|
|
76
81
|
*/
|
|
77
82
|
function isNetworkError(error) {
|
|
83
|
+
// AbortError means intentional cancellation - don't retry
|
|
84
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
78
87
|
if (error instanceof TypeError) {
|
|
79
88
|
const message = error.message.toLowerCase();
|
|
80
89
|
return (message.includes('fetch') ||
|
|
81
90
|
message.includes('network') ||
|
|
82
91
|
message.includes('failed') ||
|
|
83
|
-
message.includes('aborted') ||
|
|
84
92
|
message.includes('timeout'));
|
|
85
93
|
}
|
|
86
|
-
// Handle AbortError
|
|
87
|
-
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
94
|
return false;
|
|
91
95
|
}
|
|
92
96
|
/**
|