Skip to content

Commit

Permalink
Added other types of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jdahmen-splunk committed Jan 28, 2025
1 parent c8d79e0 commit 218c759
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/flagd/demo.flagd.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"API fetch error": "api_err",
"off": "off"
},
"defaultVariant": "Database timeout"
"defaultVariant": "API fetch error"
},
"slowRecommendationRegionSpan": {
"description": "Create a slow 5sec span in the recommendation service (get_product_list) for the San Francisco region",
Expand Down
6 changes: 3 additions & 3 deletions src/recommendation/recommendation_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ def get_product_list(request_product_ids):
time.sleep(10)
raise TimeoutError("Request to the database timed out")
elif errs_enabled_value == "db_conn_err":
pass
raise ConnectionError("Unable to connect to the database")
elif errs_enabled_value == "api_err":
pass
raise RuntimeError("Failed to fetch product info from external api")
else:
pass
raise Exception("An unknown error occured")



Expand Down

0 comments on commit 218c759

Please sign in to comment.