mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-12 07:06: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
|
||||
await this.openFilePromise.promise;
|
||||
} 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
|
||||
return;
|
||||
}
|
||||
@ -804,6 +807,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
||||
}
|
||||
|
||||
class InterruptWorkspaceRestoreError extends Error {
|
||||
public readonly isInterruptWorkspaceRestoreError = true;
|
||||
|
||||
constructor() {
|
||||
super(
|
||||
"Received 'open-file' event. Interrupting the default launch workflow."
|
||||
|
Loading…
x
Reference in New Issue
Block a user