Skip to content

Commit

Permalink
fix: handle cases where the response from upstream is a valid 200 res…
Browse files Browse the repository at this point in the history
…ponse but contains invalid data (#330)
  • Loading branch information
sighphyre authored Nov 18, 2024
1 parent 800bf77 commit feb7aa7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions UnleashClient/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ def load_features(
)
return

warnings = engine.take_state(feature_provisioning)
if warnings:
LOGGER.warning(
"Some features were not able to be parsed correctly, they may not evaluate as expected"
)
LOGGER.warning(warnings)
try:
warnings = engine.take_state(feature_provisioning)
if warnings:
LOGGER.warning(
"Some features were not able to be parsed correctly, they may not evaluate as expected"
)
LOGGER.warning(warnings)
except Exception as e:
LOGGER.error(f"Error loading features: {e}")
LOGGER.debug(f"Full feature response body from server: {feature_provisioning}")

0 comments on commit feb7aa7

Please sign in to comment.