Skip to content

Commit

Permalink
Quit Electron app when back end fails to start. Fixes #12769
Browse files Browse the repository at this point in the history
Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <[email protected]>
  • Loading branch information
tsmaeder committed Jul 28, 2023
1 parent 6607185 commit 3f8c4db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ module.exports = Promise.resolve()${this.compileElectronMainModuleImports(electr
if (reason) {
console.error(reason);
}
app.quit();
});
`;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/electron-main/electron-main-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,9 @@ export class ElectronMainApplication {
backendProcess.on('error', error => {
reject(error);
});
backendProcess.on('exit', () => {
reject(new Error('backend process exited'));
})
app.on('quit', () => {
// Only issue a kill signal if the backend process is running.
// eslint-disable-next-line no-null/no-null
Expand Down

0 comments on commit 3f8c4db

Please sign in to comment.