Skip to content

Commit b05c098

Browse files
cherrypick(release-1.4): throw unexpected platform error upon call (#3946)
Cherry-pick: - PR #3943 SHA 0090cd943c8c724cb0fe8b02f4fd7f7e7ba837bd References #3919 and #3935 Co-authored-by: Pavel Feldman <[email protected]>
1 parent e79eada commit b05c098

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/client/browserType.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export class BrowserType extends ChannelOwner<channels.BrowserTypeChannel, chann
5454
}
5555

5656
executablePath(): string {
57+
if (!this._initializer.executablePath)
58+
throw new Error('Browser is not supported on current platform');
5759
return this._initializer.executablePath;
5860
}
5961

src/server/browserType.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type WebSocketNotPipe = { webSocketRegex: RegExp, stream: 'stdout' | 'stderr' };
4747

4848
export abstract class BrowserTypeBase implements BrowserType {
4949
private _name: string;
50-
private _executablePath: string | undefined;
50+
private _executablePath: string;
5151
private _webSocketNotPipe: WebSocketNotPipe | null;
5252
private _browserDescriptor: browserPaths.BrowserDescriptor;
5353
readonly _browserPath: string;
@@ -57,13 +57,11 @@ export abstract class BrowserTypeBase implements BrowserType {
5757
const browsersPath = browserPaths.browsersPath(packagePath);
5858
this._browserDescriptor = browser;
5959
this._browserPath = browserPaths.browserDirectory(browsersPath, browser);
60-
this._executablePath = browserPaths.executablePath(this._browserPath, browser);
60+
this._executablePath = browserPaths.executablePath(this._browserPath, browser) || '';
6161
this._webSocketNotPipe = webSocketOrPipe;
6262
}
6363

6464
executablePath(): string {
65-
if (!this._executablePath)
66-
throw new Error('Browser is not supported on current platform');
6765
return this._executablePath;
6866
}
6967

0 commit comments

Comments
 (0)