mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-14 06:46:36 +00:00
try object instead of error
This commit is contained in:
parent
9c80246603
commit
62ca431cba
@ -291,7 +291,9 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
if (sketchFolderPath) {
|
if (sketchFolderPath) {
|
||||||
this.openFilePromise.reject(new InterruptWorkspaceRestoreError());
|
this.openFilePromise.reject({
|
||||||
|
name: 'InterruptWorkspaceRestoreError',
|
||||||
|
});
|
||||||
await this.openSketch(sketchFolderPath);
|
await this.openSketch(sketchFolderPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,10 +331,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
|||||||
// 2. A short timeout resolves the promise automatically, falling back to the usual app launch
|
// 2. A short timeout resolves the promise automatically, falling back to the usual app launch
|
||||||
await this.openFilePromise.promise;
|
await this.openFilePromise.promise;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (
|
if (err && (err as any).name === 'InterruptWorkspaceRestoreError') {
|
||||||
err &&
|
|
||||||
(err as InterruptWorkspaceRestoreError).isInterruptWorkspaceRestoreError
|
|
||||||
) {
|
|
||||||
// Application has received the `open-file` event and will skip the default application launch
|
// Application has received the `open-file` event and will skip the default application launch
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user