fix: Throw OpenFeature errors for unsupported flag types#17
Draft
caitlynstocker wants to merge 2 commits into
Draft
fix: Throw OpenFeature errors for unsupported flag types#17caitlynstocker wants to merge 2 commits into
caitlynstocker wants to merge 2 commits into
Conversation
caitlynstocker
commented
Jun 3, 2026
| this.client = null; | ||
| this.currentContext = context; | ||
| this.initialized = true; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This feels weird to me, but I don't know Java and I've had some long convos with Claude insisting it's correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background 🌇
At present, OctoToggle only supports boolean type feature flags, however the OpenFeature SDK also allows string, integer, number and object type feature flags. Currently when we attempt to solve for a non-boolean value, we throw a NotImplementedException, however OpenFeature provides us with error types which would give a more informative response.
What this? 🐦
This PR adjusts each of our functions which resolve a non-boolean feature flag to return:
As part of this, I've converted the slug existence check in OctopusContext into a shared function which can be used by OctopusProvider.
Testing 🧪
✅ Tested manually - both error types are throwing correctly and valid slugs can still be evaluated for.
✅ Unit tested with the tests included with this PR.
Considering that these error messages are not core functionality, unit tests are fine for now. We also considered adding specifications tests. However this would have required a separate schema and test class for the non-boolean cases, potentially causing us problems later if we're adding other flag types.
How to review? 🔍
💬 Check the comments on the code
Part of DEVEX-255