Skip to content

Commit

Permalink
Exception must be thrown outside the retry loop (#401)
Browse files Browse the repository at this point in the history
* Exception must be thrown outside the retry loop

* package-lock.json

* Revert "package-lock.json"

This reverts commit 2b266d6.

---------

Co-authored-by: CK Kashyap <ckk@microsoft.com>
  • Loading branch information
ckkashyap and ckkMicrosoft authored Apr 17, 2023
1 parent fb239fe commit c2f9b2a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/directLineStreaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2f9b2a

Please sign in to comment.