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

fix: properly handle rejections on createPackageWithOptions #254

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

erikian
Copy link
Member

@erikian erikian commented Dec 6, 2022

Minor cleanup: asar.createPackageWithOptions doesn't take a fourth argument, so it's safe to remove it

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the promise be handled?

@erikian
Copy link
Member Author

erikian commented Dec 6, 2022

Probably, but unless we output a more useful error message or do something else on rejections, moving the callback we had to a .catch will do basically the same an unhandled rejection already does: output the error message, the stack and exit with a non-zero code.

@malept
Copy link
Member

malept commented Dec 6, 2022

I think Node.js also outputs UnhandledRejection, which isn't ideal.

@erikian
Copy link
Member Author

erikian commented Dec 6, 2022

Good point, I was testing in node 16 which doesn't show that message anymore 😅

I've changed error.stack to just error as error.stack seems non-standard. They both show the error message and stack for me (node 16 on Windows), and as a bonus, the error output has some formatting now.

@erikian erikian changed the title refactor: remove unused callback passed to createPackageWithOptions refactor: properly handle rejections on createPackageWithOptions Dec 6, 2022
@erikian erikian changed the title refactor: properly handle rejections on createPackageWithOptions fix: properly handle rejections on createPackageWithOptions Jan 3, 2023
@erikian erikian requested a review from malept January 4, 2023 13:50
@erikian erikian force-pushed the refactor/remove-unused-callback branch from 06a1a85 to 5b23e6e Compare January 28, 2023 01:24
@erikian erikian requested a review from a team as a code owner January 28, 2023 01:24
@erikian erikian merged commit f60a4c1 into electron:main Sep 19, 2023
@erikian erikian deleted the refactor/remove-unused-callback branch September 19, 2023 00:25
@continuous-auth
Copy link

🎉 This PR is included in version 3.2.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants