Skip to content

Commit b2a4734

Browse files
committed
add errors if waitUntil fails
1 parent c29a589 commit b2a4734

File tree

1 file changed

+8
-2
lines changed
  • packages/core/src/shared/fs

1 file changed

+8
-2
lines changed

packages/core/src/shared/fs/fs.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,10 @@ export class FileSystem {
305305

306306
await write(uri)
307307
if (isWin()) {
308-
await waitUntil(async () => await fs.exists(uri), { timeout: 5000, truthy: true })
308+
const success = await waitUntil(async () => await fs.exists(uri), { timeout: 5000, truthy: true })
309+
if (!success) {
310+
throw new ToolkitError(`Failed to write file ${uri.toString()}`)
311+
}
309312
}
310313
}
311314

@@ -467,7 +470,10 @@ export class FileSystem {
467470

468471
// Windows race condition
469472
if (isWin()) {
470-
await waitUntil(async () => !(await fs.exists(fileOrDir)), { timeout: 5000, truthy: true })
473+
const success = await waitUntil(async () => !(await fs.exists(fileOrDir)), { timeout: 5000, truthy: true })
474+
if (!success) {
475+
throw new ToolkitError(`Failed to delete file ${uri.toString()}`)
476+
}
471477
}
472478
}
473479

0 commit comments

Comments
 (0)