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
[Feature Request]: Exit App instance when main package throws error on load #40606
Open
3 tasks done
Labels
Comments
Workarround until this is fixed: Encapsulate the whole main script in a try/catch block. try
{
... main script code goes here ...
} catch (error)
{
try
{
// avoid https://github.com/electron/electron/issues/40606
console.error("cannot init main script", error);
dialog.showErrorBox("Cannot start Electron App", error.stack || error);
} finally
{
app.exit(1);
}
}
|
regnete
added a commit
to sitewaerts/cordova-electron
that referenced
this issue
Dec 1, 2023
jkleinsc
changed the title
[Bug]: App instance not exiting when main package throws error on load
[Feature Request]: Exit App instance when main package throws error on load
Jan 9, 2024
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preflight Checklist
Electron Version
27.0.2
What operating system are you using?
Windows
Operating System Version
Windows 10 Enterprise 22H2 19045.3693
What arch are you using?
x64
Last Known Working Electron version
n/a
Expected Behavior
If an error occurs while loading the main package an error message should be displayed and the app must exit with an error code.
Actual Behavior
If an error occurs while loading the main package an error message is displayed but the app contunues to run. In windows taskmanager several task 'name_of_the_app.exe' keep runing, even if the error panel is closed by hitting 'OK'.
Testcase Gist URL
No response
Additional Information
I guess the issue could be resolved by modifying code in
electron/default_app/main.ts
Line 140 in 79e714a
Current code:
Fixed code:
The text was updated successfully, but these errors were encountered: