Skip to content

Commit 62ca431

Browse files
committedApr 4, 2025·
try object instead of error
1 parent 9c80246 commit 62ca431

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
291291
true
292292
);
293293
if (sketchFolderPath) {
294-
this.openFilePromise.reject(new InterruptWorkspaceRestoreError());
294+
this.openFilePromise.reject({
295+
name: 'InterruptWorkspaceRestoreError',
296+
});
295297
await this.openSketch(sketchFolderPath);
296298
}
297299
}
@@ -329,10 +331,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
329331
// 2. A short timeout resolves the promise automatically, falling back to the usual app launch
330332
await this.openFilePromise.promise;
331333
} catch (err) {
332-
if (
333-
err &&
334-
(err as InterruptWorkspaceRestoreError).isInterruptWorkspaceRestoreError
335-
) {
334+
if (err && (err as any).name === 'InterruptWorkspaceRestoreError') {
336335
// Application has received the `open-file` event and will skip the default application launch
337336
return;
338337
}

0 commit comments

Comments
 (0)
Please sign in to comment.