Skip to content

Commit feb7aa7

Browse files
authored
fix: handle cases where the response from upstream is a valid 200 response but contains invalid data (#330)
1 parent 800bf77 commit feb7aa7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

UnleashClient/loader.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ def load_features(
2525
)
2626
return
2727

28-
warnings = engine.take_state(feature_provisioning)
29-
if warnings:
30-
LOGGER.warning(
31-
"Some features were not able to be parsed correctly, they may not evaluate as expected"
32-
)
33-
LOGGER.warning(warnings)
28+
try:
29+
warnings = engine.take_state(feature_provisioning)
30+
if warnings:
31+
LOGGER.warning(
32+
"Some features were not able to be parsed correctly, they may not evaluate as expected"
33+
)
34+
LOGGER.warning(warnings)
35+
except Exception as e:
36+
LOGGER.error(f"Error loading features: {e}")
37+
LOGGER.debug(f"Full feature response body from server: {feature_provisioning}")

0 commit comments

Comments
 (0)