mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-15 16:46:32 +00:00
use class variable to identify custom error
This commit is contained in:
parent
e36f393682
commit
9c80246603
@ -329,7 +329,10 @@ 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 (err instanceof InterruptWorkspaceRestoreError) {
|
if (
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
@ -804,6 +807,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class InterruptWorkspaceRestoreError extends Error {
|
class InterruptWorkspaceRestoreError extends Error {
|
||||||
|
public readonly isInterruptWorkspaceRestoreError = true;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(
|
super(
|
||||||
"Received 'open-file' event. Interrupting the default launch workflow."
|
"Received 'open-file' event. Interrupting the default launch workflow."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user