From 06f05d896f31bbfac39efbc61b4b5154258318de Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 27 Sep 2023 11:29:22 +0200 Subject: [PATCH] Merge pull request #14973 from overleaf/jpa-fix-reject-error [web] history pane: fix reject with undefined error GitOrigin-RevId: a08ee2e6d9ff60d50c9f4b033259d19dc9f58a6d --- .../web/frontend/js/features/history/utils/wait-for.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/web/frontend/js/features/history/utils/wait-for.ts b/services/web/frontend/js/features/history/utils/wait-for.ts index 48365c9608..f7ef2cdd21 100644 --- a/services/web/frontend/js/features/history/utils/wait-for.ts +++ b/services/web/frontend/js/features/history/utils/wait-for.ts @@ -9,11 +9,11 @@ export function waitFor( return new Promise((resolve, reject) => { const tryIteration = () => { if (iterations > iterationLimit) { - reject( - console.error( - `waiting too long, ${JSON.stringify({ timeout, pollInterval })}` - ) + const err = new Error( + `waiting too long, ${JSON.stringify({ timeout, pollInterval })}` ) + console.error(err) + reject(err) return }