8000 [WIP] Use class variable to identify `InterruptWorkspaceRestoreError` error by davegarthsimpson · Pull Request #2689 · arduino/arduino-ide · GitHub
[go: up one dir, main page]

Skip to content

[WIP] Use class variable to identify InterruptWorkspaceRestoreError error #2689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use class variable to identify custom error
  • Loading branch information
davegarthsimpson committed Apr 4, 2025
commit 9c8024660373f398506b84f3f52865f6054b093c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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."
Expand Down
Loading
0