Skip to content

fix(action): fix unhandled promise rejection #32

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

Merged

Conversation

benatshippabo
Copy link
Contributor

@benatshippabo benatshippabo commented Aug 18, 2021

Summary

This fixes the unhandled promise rejection when something errors out inside main. An example would be when one of the git commands fail such as pushing to a write protected branch, you would see this message but the action still passes:

(node:1625) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1625) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It is fixed by using core.setFailed documented here.

Related issues: #2 #9

@Wattenberger
Copy link
Contributor

this is great, thanks for the PR!

@Wattenberger Wattenberger merged commit eb6863e into githubocto:main Aug 18, 2021
ageorgou added a commit to ageorgou/repo-visualizer that referenced this pull request Aug 22, 2021
Wattenberger pushed a commit that referenced this pull request Aug 23, 2021
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 this pull request may close these issues.

2 participants