@forge/cli-shared

9.3.1-next.1-experimental-0b00ed89.3.1-next.2
out/shared/error-handling.js
~out/shared/error-handling.jsModified
+4−30
Index: package/out/shared/error-handling.js
===================================================================
--- package/out/shared/error-handling.js
+++ package/out/shared/error-handling.js
@@ -10,42 +10,16 @@
 const assistant_cli_1 = require("./assistant-cli");
 function isErrorWithAnalytics(e) {
     return e.getAttributes !== undefined;
 }
-const NETWORK_CONNECTIVITY_ERROR_CODES = new Set([
-    'ENOTFOUND',
-    'ECONNRESET',
-    'ECONNREFUSED',
-    'ECONNABORTED',
-    'ENETUNREACH',
-    'EHOSTUNREACH',
-    'EAI_AGAIN',
-    'ETIMEDOUT',
-    'UND_ERR_CONNECT_TIMEOUT',
-    'UND_ERR_HEADERS_TIMEOUT',
-    'UND_ERR_SOCKET'
-]);
-function isLikelyNetworkError(e) {
-    if (!(e instanceof Error)) {
-        return false;
-    }
-    if (e instanceof TypeError && e.message === 'fetch failed') {
-        const causeCode = e.cause && typeof e.cause === 'object' && typeof e.cause.code === 'string'
-            ? e.cause.code
-            : undefined;
-        return causeCode ? NETWORK_CONNECTIVITY_ERROR_CODES.has(causeCode) : false;
-    }
-    if (e.constructor?.name === 'FetchError' && e.type === 'system') {
-        return true;
-    }
-    return false;
-}
 function isUserError(e) {
     if (isErrorWithAnalytics(e)) {
         return e.getAttributes().isUserError ?? false;
     }
-    if (isLikelyNetworkError(e)) {
-        return true;
+    if (e.constructor?.name === 'FetchError') {
+        if (e.type === 'system') {
+            return true;
+        }
     }
     return false;
 }
 function getErrorAttributes(e) {