You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the feature flag does not exist, the following error is raised: FlagsmithClientError("Feature does not exist: <my_feature>")
If the environment failed to do an API request, the following error is raised: FlagsmithClientError("Feature does not exist: <my_feature>")
I would like to raise different alerts in those cases, because the fix to the problems are not the same (i.e., waiting for it to resolve itself vs adding the flag or removing the code using the flag).
Could we have a way to differentiate them?
Suggestions
Flags could have an attribute to store the fact that the Flags were created following a FlagsmithAPIError, then, different errors could be raised in Flags.get_flag() using this attribute.
or
The default_flag_handler() could have a parameter that would indicate the type of error.
The text was updated successfully, but these errors were encountered:
Hi @AdrianB-sovo, thanks for this. It's an interesting point and I certainly understand the request. As per your first suggestion, I think that adding a parameter to the Flags object to indicate if the request to the API was successful or not would be the best way to solve this.
Would you be up for submitting a PR for this? Otherwise we will add this to our backlog.
When doing:
FlagsmithClientError("Feature does not exist: <my_feature>")
FlagsmithClientError("Feature does not exist: <my_feature>")
I would like to raise different alerts in those cases, because the fix to the problems are not the same (i.e., waiting for it to resolve itself vs adding the flag or removing the code using the flag).
Could we have a way to differentiate them?
Suggestions
FlagsmithAPIError
, then, different errors could be raised inFlags.get_flag()
using this attribute.or
default_flag_handler()
could have a parameter that would indicate the type of error.The text was updated successfully, but these errors were encountered: