From c2f9b2a6b24ca59307443ea7cc097cf0a993cea7 Mon Sep 17 00:00:00 2001 From: Kashyap Date: Mon, 17 Apr 2023 14:07:26 -0700 Subject: [PATCH] Exception must be thrown outside the retry loop (#401) * Exception must be thrown outside the retry loop * package-lock.json * Revert "package-lock.json" This reverts commit 2b266d66f3680f76ee7ebdbfc3a12a59de71405e. --------- Co-authored-by: CK Kashyap --- src/directLineStreaming.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/directLineStreaming.ts b/src/directLineStreaming.ts index cd5b2b78..461bb0f1 100644 --- a/src/directLineStreaming.ts +++ b/src/directLineStreaming.ts @@ -337,11 +337,12 @@ export class DirectLineStreaming implements IBotConnection { } } catch (err) { console.error(`Failed to connect ${err}`); - throw(err); } await new Promise(r => setTimeout(r, this.getRetryDelay())); } + + throw (new Error(`Failed to connect after ${MAX_RETRY_COUNT} attempts`)); } // Returns the delay duration in milliseconds