-
Notifications
You must be signed in to change notification settings - Fork 43
feat: error resolution flow control without exceptions #1095
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
Merged
toddbaert
merged 6 commits into
open-feature:main
from
open-feature-forking:issue/allow_flowcontrol_without_exceptions
Sep 17, 2024
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4fb8e6b
Allowing flowcontrol with out exceptions
aepfli 7276acb
Merge branch 'main' into issue/allow_flowcontrol_without_exceptions
aepfli 3d4b992
fix: adding reason, and removing stacktraces from errors
aepfli c3be65b
Update src/main/java/dev/openfeature/sdk/exceptions/TypeMismatchError…
aepfli 137faf3
Merge branch 'main' into issue/allow_flowcontrol_without_exceptions
aepfli 430ba1c
Merge branch 'main' into issue/allow_flowcontrol_without_exceptions
aepfli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
53 changes: 53 additions & 0 deletions
53
src/test/java/dev/openfeature/sdk/AlwaysBrokenWithDetailsProvider.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package dev.openfeature.sdk; | ||
|
||
import dev.openfeature.sdk.exceptions.FlagNotFoundError; | ||
|
||
public class AlwaysBrokenWithDetailsProvider implements FeatureProvider { | ||
|
||
@Override | ||
public Metadata getMetadata() { | ||
return () -> { | ||
throw new FlagNotFoundError(TestConstants.BROKEN_MESSAGE); | ||
}; | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Boolean> getBooleanEvaluation(String key, Boolean defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<Boolean>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<String> getStringEvaluation(String key, String defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<String>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<Integer>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Double> getDoubleEvaluation(String key, Double defaultValue, EvaluationContext ctx) { | ||
return ProviderEvaluation.<Double>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ProviderEvaluation<Value> getObjectEvaluation(String key, Value defaultValue, EvaluationContext invocationContext) { | ||
return ProviderEvaluation.<Value>builder() | ||
.errorMessage(TestConstants.BROKEN_MESSAGE) | ||
.errorCode(ErrorCode.FLAG_NOT_FOUND) | ||
.build(); | ||
} | ||
} |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.