Skip to content

Commit

Permalink
fix: improve exception handling billing request
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlukasse authored Nov 13, 2023
1 parent 9ab3654 commit f86a632
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/argowrapper/routes/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def check_user_billing_id(request):
r.raise_for_status()
user_info = r.json()
except Exception as e:
logger.error("Could not determine user info from fence")
logger.error(e)
raise
exception = Exception("Could not determine user billing info from fence", e)
logger.error(exception)
raise exception

if "tags" in user_info and "billing_id" in user_info["tags"]:
billing_id = user_info["tags"]["billing_id"]
Expand All @@ -182,11 +182,10 @@ def submit_workflow(
request_body: Dict[Any, Any],
request: Request, # pylint: disable=unused-argument
) -> str:
"""check if user has a billing id tag"""
billing_id = check_user_billing_id(request)

"""route to submit workflow"""
try:
# check if user has a billing id tag"""
billing_id = check_user_billing_id(request)
return argo_engine.workflow_submission(
request_body, request.headers.get("Authorization"), billing_id
)
Expand Down

0 comments on commit f86a632

Please sign in to comment.