Merge pull request #14973 from overleaf/jpa-fix-reject-error

[web] history pane: fix reject with undefined error

GitOrigin-RevId: a08ee2e6d9ff60d50c9f4b033259d19dc9f58a6d
This commit is contained in:
Jakob Ackermann 2023-09-27 11:29:22 +02:00 committed by Copybot
parent 45ca0f796c
commit 06f05d896f

View file

@ -9,11 +9,11 @@ export function waitFor<T>(
return new Promise<T>((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
}