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

Get "Download Error" when using save as dialog and cancel button is pressed #166

Closed
theogravity opened this issue Jan 30, 2024 · 1 comment · Fixed by #167
Closed

Get "Download Error" when using save as dialog and cancel button is pressed #166

theogravity opened this issue Jan 30, 2024 · 1 comment · Fixed by #167

Comments

@theogravity
Copy link
Contributor

theogravity commented Jan 30, 2024

image

Not sure why it happens even though it's surrounded with a try / catch.

// main/index.ts
electronDl({
  saveAs: true,
});

// IPC handler
      try {
        await download(window, url, {
          saveAs: true,
          filename,
        });
      } catch (e) {
        this.log.withError(e).error('Unable to download file');
      }
@theogravity
Copy link
Contributor Author

After more investigation, it seems I don't even need the await download() call to reproduce it. I just need to call:

mainWindow.webContents.downloadURL(..)

If I remove the electronDl() init call, then I won't get the error when canceling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant