Skip to content

Commit

Permalink
handle exception
Browse files Browse the repository at this point in the history
  • Loading branch information
harisang committed May 10, 2023
1 parent 829c322 commit 7a5ba04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/quasimodo_ebbo/on_chain_surplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ def get_solver_response(order_id: str, bucket_response: Any) -> Tuple[Any, Any]:
+ "/solve?time_limit=20&use_internal_buffers=false&objective=surplusfeescosts"
)
# make solution request to quasimodo
solution = requests.post(solver_url, data=bucket_response_json, timeout=30)
try:
solution = requests.post(solver_url, data=bucket_response_json, timeout=30)
except requests.exceptions.RequestException as e:
# return empty response
return {"prices": []}, None
solution_json = solution.json()
# return quasimodo solved solution
return solution_json, order
Expand Down

0 comments on commit 7a5ba04

Please sign in to comment.