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

[BUG] Error hooks only run if the provider throws #925

Closed
beeme1mr opened this issue May 1, 2024 · 1 comment · Fixed by #926
Closed

[BUG] Error hooks only run if the provider throws #925

beeme1mr opened this issue May 1, 2024 · 1 comment · Fixed by #926
Assignees
Labels
bug Something isn't working

Comments

@beeme1mr
Copy link
Member

beeme1mr commented May 1, 2024

Observed behavior

The error hook only runs if the provider throws an exception. However, it's possible for a provider to return an error code in the ResolutionDetails.

Expected Behavior

The error hook runs if the ResolutionDetails contains an errorCode

Steps to reproduce

  1. Register a provider that returns a ResolutionDetails object with an errorCode
  2. Register a hook that relies on the error hook
  3. Evaluate a flag
@beeme1mr beeme1mr added the bug Something isn't working label May 1, 2024
@beeme1mr
Copy link
Member Author

beeme1mr commented May 1, 2024

We should add some clarifying text to the spec once this issue is addressed.

https://openfeature.dev/specification/sections/hooks#requirement-437

@beeme1mr beeme1mr self-assigned this May 1, 2024
github-merge-queue bot pushed a commit that referenced this issue May 8, 2024
…926)

## This PR

- runs error hook when provider returns reason error or error code

### Related Issues

Fixes #925

### Notes

Based on a conversation in Slack:
https://cloud-native.slack.com/archives/C06E4DE6S07/p1714581197391509

---------

Signed-off-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant