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

UnhandledPromiseRejectionWarning #10

Closed
oalders opened this issue Oct 1, 2019 · 8 comments · Fixed by #29
Closed

UnhandledPromiseRejectionWarning #10

oalders opened this issue Oct 1, 2019 · 8 comments · Fixed by #29

Comments

@oalders
Copy link
Contributor

oalders commented Oct 1, 2019

I ran into this here: https://github.com/oalders/changelog-generator/pull/1/checks?check_run_id=242518473

It was supposed to set up 3 default labels. Two of them already existed, albeit with different letter casing. The delete worked, but only one label Hacktoberfest existed. Bug and Enhancement did not get created.

Run lannonbr/issue-label-manager-action@master
[Action] Deleting Label: bug
[Action] Deleting Label: duplicate
[Action] Deleting Label: enhancement
[Action] Deleting Label: good first issue
[Action] Deleting Label: help wanted
[Action] Deleting Label: invalid
[Action] Deleting Label: question
[Action] Deleting Label: wontfix
[Action] Creating Label: Bug
[Action] Creating Label: Enhancement
[Action] Creating Label: Hacktoberfest
(node:2745) UnhandledPromiseRejectionWarning: HttpError: Validation Failed
    at /home/runner/work/_actions/lannonbr/issue-label-manager-action/master/lib/index.js:86:941
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
    at async /home/runner/work/_actions/lannonbr/issue-label-manager-action/master/lib/index.js:202:1214
(node:2745) 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:2745) [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.
(node:2745) UnhandledPromiseRejectionWarning: HttpError: Validation Failed
    at /home/runner/work/_actions/lannonbr/issue-label-manager-action/master/lib/index.js:86:941
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
    at async /home/runner/work/_actions/lannonbr/issue-label-manager-action/master/lib/index.js:202:1214
(node:2745) 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: 2)
@haltcase
Copy link

I think this may be the same issue as mine, #9.

@crazy-max
Copy link

Can you test with my labeler action? Maybe it's an issue with octokit.

@haltcase
Copy link

@crazy-max your implementation works.

@schalkneethling
Copy link
Contributor

For me, it seemed to create all the labels, but I also see the same failures.

@schalkneethling
Copy link
Contributor

schalkneethling commented Feb 25, 2022

@oalders I am wondering if the problem could be related to this line:

if (newLabelsNames.includes(oLabel)) {

When comparing strings or characters, this function is case-sensitive so, infra and Infra will not match. Could that perhaps cause an error to be thrown in

labelModList.forEach(async mod => {
, as it will be set to create instead of update.

So perhaps this could solve the errors?

if (newLabelsNames.toLowerCase().includes(oLabel.toLowerCase())) {

@oalders
Copy link
Contributor Author

oalders commented Mar 1, 2022

@schalkneethling I actually don't know. I opened this issue a few years ago and kind of moved on to other things after I hit this problem.

@schalkneethling
Copy link
Contributor

@schalkneethling I actually don't know. I opened this issue a few years ago and kind of moved on to other things after I hit this problem.

I reckon I will open a pull request and see where it goes from there. Thank you for getting back to me.

@lannonbr
Copy link
Owner

lannonbr commented Mar 5, 2022

This should now be resolved as of release 3.0.1

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.

6 participants
@oalders @crazy-max @lannonbr @schalkneethling @haltcase and others