electron-builder: Updater causes uncaught exception in the main process if download interrupted

  • 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: image

[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. image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

I ran into the problem today also. It remains unresolved and I’ve found no way to catch and handle the error graciously.