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

Ensure loadApiError is caught #882

Merged
merged 5 commits into from
Jan 24, 2022
Merged

Ensure loadApiError is caught #882

merged 5 commits into from
Jan 24, 2022

Conversation

aeisenberg
Copy link
Contributor

@aeisenberg aeisenberg commented Jan 21, 2022

And add a better error message.

By using void instead of await, any error thrown is not caught
by surrounding try-catch blocks.

I could continue to use void and explicitly handle any thrown errors
by using .catch, but most likely the time savings is minimal and
this makes the code more complex.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

And add a better error message.

By using `void` instead of `await`, any error thrown is not caught
by surrounding try-catch blocks.

I could continue to use `void` and explicitly handle any thrown errors
by using `.catch`, but most likely the time savings is minimal and
this makes the code more complex.
@aeisenberg aeisenberg requested a review from a team as a code owner January 21, 2022 18:04
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

I was just looking at this too. Couple of suggestions.

CHANGELOG.md Outdated Show resolved Hide resolved
src/feature-flags.ts Outdated Show resolved Hide resolved
src/feature-flags.ts Outdated Show resolved Hide resolved
src/init-action.ts Outdated Show resolved Hide resolved
Discussion here #882 (comment)
shows that properly handling preloading feature flag errors is complex
and the benefit we get from it does not offset the complexity.
@edoardopirovano
Copy link
Contributor

I haven't reviewed the code since Henry seems to have it covered (although happy to if you would like another set of eyes), but could I ask to hold off merging this until Tuesday since it seems like a potentially risky change to put into GHES 3.4 at the last minute?

@aeisenberg
Copy link
Contributor Author

Thanks for the reminder. I don't think this is a required fix for GHES 3.4. I will hold off on the merge.

Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

A couple of suggestions, otherwise LGTM to get in after the GHES 3.4 release.

src/feature-flags.test.ts Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@edoardopirovano
Copy link
Contributor

I've done the release that is going into GHES 3.4 so please do not consider this blocked on that anymore 👍🏼

Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

Thanks!

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.

4 participants