From da022d1a8aa1e22494c9f7c482caf84bc0b8371c Mon Sep 17 00:00:00 2001 From: Warren Parad Date: Mon, 13 Nov 2023 15:27:35 +0100 Subject: [PATCH] Don't assume error has a name property. --- src/httpClient.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/httpClient.js b/src/httpClient.js index 2ad8f7e..4fc550b 100644 --- a/src/httpClient.js +++ b/src/httpClient.js @@ -11,13 +11,7 @@ const errorMessages = new Set([ ]); function isNetworkError(error) { - const isValid = error && error.name === 'TypeError' && typeof error.message === 'string'; - - if (!isValid) { - return false; - } - - return errorMessages.has(error.message); + return error && error.message && errorMessages.has(error.message); } async function retryExecutor(func) {