From 751a4bb2cec6dafdf552dd9050e09c643d796dd8 Mon Sep 17 00:00:00 2001 From: tyiuhc Date: Mon, 29 Jan 2024 16:08:46 -0800 Subject: [PATCH] fix retry conditional --- packages/node/src/remote/client.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/node/src/remote/client.ts b/packages/node/src/remote/client.ts index 7f854fe..0a6a175 100644 --- a/packages/node/src/remote/client.ts +++ b/packages/node/src/remote/client.ts @@ -69,14 +69,14 @@ export class RemoteEvaluationClient { return await this.doFetch(user, this.config.fetchTimeoutMillis, options); } catch (e) { console.error('[Experiment] Fetch failed: ', e); - if (!this.shouldRetryFetch(e)) { - throw e; - } - try { - return await this.retryFetch(user, options); - } catch (e) { - console.error(e); + if (this.shouldRetryFetch(e)) { + try { + return await this.retryFetch(user, options); + } catch (e) { + console.error(e); + } } + throw e; } }