Skip to content

Commit 9c80246

Browse files
use class variable to identify custom error
1 parent e36f393 commit 9c80246

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
329329
// 2. A short timeout resolves the promise automatically, falling back to the usual app launch
330330
await this.openFilePromise.promise;
331331
} catch (err) {
332-
if (err instanceof InterruptWorkspaceRestoreError) {
332+
if (
333+
err &&
334+
(err as InterruptWorkspaceRestoreError).isInterruptWorkspaceRestoreError
335+
) {
333336
// Application has received the `open-file` event and will skip the default application launch
334337
return;
335338
}
@@ -804,6 +807,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
804807
}
805808

806809
class InterruptWorkspaceRestoreError extends Error {
810+
public readonly isInterruptWorkspaceRestoreError = true;
811+
807812
constructor() {
808813
super(
809814
"Received 'open-file' event. Interrupting the default launch workflow."

0 commit comments

Comments
 (0)