File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ def _resolve(
116
116
if flag is None :
117
117
return FlagResolutionDetails (
118
118
value = default_value ,
119
- reason = Reason .DEFAULT ,
120
- variant = PASSED_IN_DEFAULT ,
119
+ reason = Reason .ERROR ,
120
+ error_code = ErrorCode .FLAG_NOT_FOUND ,
121
+ error_message = f"Flag '{ flag_key } ' not found" ,
121
122
)
122
123
return flag .resolve (evaluation_context )
Original file line number Diff line number Diff line change 1
1
from numbers import Number
2
2
3
+ from open_feature .exception .error_code import ErrorCode
3
4
from open_feature .flag_evaluation .reason import Reason
4
5
from open_feature .flag_evaluation .resolution_details import FlagResolutionDetails
5
6
from open_feature .provider .in_memory_provider import InMemoryProvider , InMemoryFlag
@@ -24,8 +25,9 @@ def test_should_handle_unknown_flags_correctly():
24
25
assert flag is not None
25
26
assert flag .value is True
26
27
assert isinstance (flag .value , bool )
27
- assert flag .reason == Reason .DEFAULT
28
- assert flag .variant == "Passed in default"
28
+ assert flag .reason == Reason .ERROR
29
+ assert flag .error_code == ErrorCode .FLAG_NOT_FOUND
30
+ assert flag .error_message == "Flag 'Key' not found"
29
31
30
32
31
33
def test_calls_context_evaluator_if_present ():
You can’t perform that action at this time.
0 commit comments