Skip to content

Commit c2943d1

Browse files
authored
Merge pull request #406 from mitchhentges/405-hoxy-error-handling
Ignores all fatal errors in main process
2 parents 60f6cbe + 97993f4 commit c2943d1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 2.1.2
2+
3+
#### Bugfixes
4+
5+
- Ignores `hoxy` errors (mitigates a cause of crashes)
6+
17
# 2.1.1
28

39
#### Bugfixes

src/main/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as process from 'process';
12
import {app, BrowserWindow, ipcMain as ipc} from 'electron';
23
import localShortcut from 'electron-localshortcut';
34
import browserLauncher from '@james-proxy/james-browser-launcher';
@@ -23,6 +24,11 @@ const urlMapper = createUrlMapper({
2324
autoload: true
2425
});
2526

27+
process.on('uncaughtException', (error) => {
28+
// TODO remove this global handler!
29+
console.warn('Ignored fatal error!', error); // eslint-disable-line no-console
30+
});
31+
2632
console.log('Starting proxy...'); // eslint-disable-line no-console
2733
const proxy = createProxy(config, urlMapper.urlMapper);
2834

0 commit comments

Comments
 (0)