Updater causes uncaught exception in the main process if download interrupted
See original GitHub issue-
Version: electron-builder:
19.52.1
electron-updater:2.18.2
-
Target:
platform=win32 arch=x64
While the updater has a download in progress, have the download interrupted. I was testing locally using the http-server
npm package, so I just terminated the server, but other interruptions like unplugging your network cable, disconnecting WiFi, putting your computer to sleep, should have the same effect.
The following dialog shows:
[Window Title]
Error
[Main Instruction]
A JavaScript error occurred in the main process
[Content]
Uncaught Exception:
Error: net::ERR_CONNECTION_RESET
[OK]
I have tried to catch the error unsuccessfully through the following methods:
updater.downloadUpdate(...).then(...).catch(function(error) { ... }
updater.signals.emitter.addListener("error", function(error) { ... }
It can be caught by putting process.on('uncaughtException', function (error) { ... }
, in NodeJS’s entry .js
file, but there is no more context to the error than what you see above, so there is no way to determine that the error came from the updater.
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (5 by maintainers)
Top GitHub Comments
I ran into the problem today also. It remains unresolved and I’ve found no way to catch and handle the error graciously.
This issue should NOT be closed, I ran the exact same issue with
"electron-updater": "4.2.0".
if the latest.yml file on my s3 bucket is deleted, all the clients will receive this message.The only way to avoid this is to listen to the uncaughtException events of node. A little risky practice.
EDITED: just update to electron 7.1.7. the error will be passed as an updater error event as intended.