Skip to content
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

autoUpdater unhandled rejection #8053

Open
skident opened this issue Feb 15, 2024 · 5 comments
Open

autoUpdater unhandled rejection #8053

skident opened this issue Feb 15, 2024 · 5 comments
Labels

Comments

@skident
Copy link

skident commented Feb 15, 2024

  • Electron-Builder Version:
    "electron-builder": "^23.3.3",
    "electron-updater": "^5.3.0",

node v18.15.0

  • Electron Version:
    "electron": "^25.3.0",
  • Electron Type (current, beta, nightly):

macOS

I have an auto update logic in my app and sometimes I get an error like this one
"Error: Cannot download "https://xxx/yyy/app.zip", status 403: Forbidden"
I am totally fine with the issue, I have a handler for such types of errors which looks like this
autoUpdater.on("error", (error) => {...});
But somehow this error is propagated to the very top level and ends up in the unhandled rejection handler. I wrapped everything with try catch blocks but anyway I get the unhandled rejection error.

Any ideas how to fix it?

@mmaietta
Copy link
Collaborator

Can you try adding additional logging to the updater flow?
https://www.electron.build/auto-update#debugging

@farhanlatheef
Copy link

@skident Found a solution for this?

@skident
Copy link
Author

skident commented Aug 28, 2024

@farhanlatheef . not really. I get too many such errors

@farhanlatheef
Copy link

@skident try this.

const update = await autoUpdater.checkForUpdates();
  if (update && update.downloadPromise) {
    update.downloadPromise.catch((error) => {
      logger.error('AutoUpdater -> checkForUpdates:', error);
    });
  }

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants