Open agardnerIT opened 2 days ago
Hi @agardnerIT, thanks for reporting this. I'm pretty sure the traceback you see printed is just a log message, and no exception is actually thrown by the SDK, as it would be against the spec. This PR removed the logged message as it was considered too verbose for the evaluation path.
From the OpenFeature spec, Requirement 1.4.10:
Methods, functions, or operations on the client MUST NOT throw exceptions, or otherwise abnormally terminate. Flag evaluation calls must always return the default value in the event of abnormal execution. Exceptions include functions or methods for the purposes for configuration or setup.
We recently updated the spec to avoid logging in hot code paths. Instead, a logging hook should be used.
Hey @agardnerIT, are you running the latest version? We reduced the logging in a previous version and I'm having trouble finding where this log message is coming from.
@federicobond @gruebel do either of you see where this log message could be coming from? I've checked both flagd and the SDK.
I'm pretty sure it's the one already removed by your PR @beeme1mr: https://github.com/open-feature/python-sdk/pull/347
It should not appear in the latest version.
Is it possible to prevent the thrown Exception and just silently use the default value?
Given the following code, the desired output would be
The current colour is: NA
but, as you can see, an exception is thrown each time I request the value. By definition this leads to log spam and is somewhat low value given that I do have a default value precisely to protect against this possibility.flags.json
Code
Result
Backwards Compatible Change
Perhaps: