Skip to content

Commit c2db4a4

Browse files
committed
Refactor error handling in browser installer
Removed premature error throw before awaiting installation promise. Now, error is only thrown after installation attempt completes, ensuring proper status check.
1 parent 0391b0b commit c2db4a4

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/utils/browser-installer.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,12 @@ export class BackgroundBrowserInstaller {
8080
return; // Already ready
8181
}
8282

83-
if (this.status === 'error') {
84-
throw new Error(
85-
'Chromium installation failed.\n\n' +
86-
'Please install manually:\n' +
87-
' bunx playwright install chromium\n\n' +
88-
`Error: ${this.error?.message || 'Unknown error'}`
89-
);
90-
}
91-
9283
// Wait for installation to complete
9384
if (this.installPromise) {
9485
await this.installPromise;
9586
}
9687

88+
// Check final status after waiting
9789
if (this.status === 'error') {
9890
throw new Error(
9991
'Chromium installation failed.\n\n' +

0 commit comments

Comments
 (0)