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: Improve error handling in OpenFeatureClient #121

Merged
merged 1 commit into from
May 7, 2024
Merged

fix: Improve error handling in OpenFeatureClient #121

merged 1 commit into from
May 7, 2024

Conversation

schodemeiss
Copy link
Contributor

This PR

The PR adds the flagKey to EvaluationDetailsBuilder during error handling, providing more context for debugging. It also includes error message within the ResolutionError for more complete error information.

How to test

Modify the NoOpProvider to throw any exception with a message. This should then propergate through to this new error handling

@schodemeiss schodemeiss requested a review from tcarrio as a code owner April 27, 2024 14:08
@schodemeiss
Copy link
Contributor Author

The failures above I don't think are related to my commit above. Not sure how you'd like me to approach resolving that?

@beeme1mr
Copy link
Member

@tcarrio do you know what phpstan is failing?

@schodemeiss
Copy link
Contributor Author

schodemeiss commented Apr 30, 2024

@tcarrio do you know what phpstan is failing?

@beeme1mr @tcarrio I can happily fix this as part of this commit? I just need to remove those 3 phpstan ignore declarations. But only if you guys are happy with me scooping this up as part of this PR?

@tcarrio
Copy link
Member

tcarrio commented May 2, 2024

I'll investigate the phpstan error

In the meantime @schodemeiss could you add or update tests around this? I love the idea of including more exception context in the error. This is a good improvement overall 👍

@tcarrio
Copy link
Member

tcarrio commented May 2, 2024

For both PRs, your commits need to be signed off for the DCO.

@tcarrio
Copy link
Member

tcarrio commented May 2, 2024

If you end up fixing the phpstan error yourself I'll definitely approve that to merge. I have a bigger PR coming down the pipeline that resolved this in #122. You could reference that if necessary. I'll fix in merge conflicts on my end if yours is ready first 😎

@tcarrio
Copy link
Member

tcarrio commented May 7, 2024

Rebasing now that main has your phpstan fixes

The commit adds the flagKey to EvaluationDetailsBuilder during error handling, providing more context for debugging. It also includes error message within the ResolutionError for more complete error information.

Signed-off-by: Andrew Menino-Barlow <[email protected]>
@tcarrio
Copy link
Member

tcarrio commented May 7, 2024

LGTM! Merging ✅

@tcarrio tcarrio merged commit 58e97d2 into open-feature:main May 7, 2024
5 checks passed
tcarrio pushed a commit that referenced this pull request May 7, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.0.6](2.0.5...2.0.6)
(2024-05-07)


### 🐛 Bug Fixes

* Improve error handling in OpenFeatureClient
([#121](#121))
([58e97d2](58e97d2))
* Use late static binding in AbstractProvider
([#123](#123))
([2123274](2123274))


### 🧹 Chore

* **deps:** update dependency psalm/plugin-phpunit to ^0.19.0
([#119](#119))
([09f9d47](09f9d47))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@schodemeiss schodemeiss deleted the fix/improve-error-handling branch May 7, 2024 05:55
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.

3 participants