From fef0b36d88e238908af5de99e9c796b2ae2a46b3 Mon Sep 17 00:00:00 2001 From: Salah-Eddine Saakoun Date: Tue, 5 Mar 2024 11:05:44 +0100 Subject: [PATCH] fix: remove useless optional chaining operator --- packages/controller-utils/src/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/controller-utils/src/util.ts b/packages/controller-utils/src/util.ts index 84fe742574..d512142ce6 100644 --- a/packages/controller-utils/src/util.ts +++ b/packages/controller-utils/src/util.ts @@ -542,12 +542,12 @@ function logOrRethrowError(error: unknown, codesToCatch: number[] = []) { if (error instanceof Error) { const includesErrorCodeToCatch = codesToCatch.some((code) => - error.message?.includes(`Fetch failed with status '${code}'`), + error.message.includes(`Fetch failed with status '${code}'`), ); if ( includesErrorCodeToCatch || - error.message?.includes('Failed to fetch') || + error.message.includes('Failed to fetch') || error === TIMEOUT_ERROR ) { console.error(error);