Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Handle no volume found instead of error 500 #581

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

1yam
Copy link
Collaborator

@1yam 1yam commented Jul 16, 2024

Issue

Problem:
When a volume is not found, it's returning error 500 instead of returning a web response

Solution:
Catch runtime error and return the error as web error

@1yam
Copy link
Collaborator Author

1yam commented Jul 16, 2024

#576

Copy link

codecov bot commented Jul 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.37%. Comparing base (73438a4) to head (09b6d5b).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #581      +/-   ##
==========================================
- Coverage   94.67%   94.37%   -0.30%     
==========================================
  Files          89       91       +2     
  Lines        4770     4908     +138     
  Branches      652      677      +25     
==========================================
+ Hits         4516     4632     +116     
- Misses        232      241       +9     
- Partials       22       35      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@1yam 1yam requested review from nesitor and hoh July 16, 2024 11:30
Copy link
Collaborator

@Psycojoker Psycojoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from a python point of view

required_tokens = compute_flow_cost(session=session, content=content)
else:
required_tokens = compute_cost(session=session, content=content)
except RuntimeError as e:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why is a RuntimeError error expected here ? Is that error not too generic ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where it can failed
It's in order to handle this error if volume is removed but not the program

@nesitor nesitor merged commit 4564534 into main Jul 25, 2024
5 of 6 checks passed
@nesitor nesitor deleted the 1yam-fix-price-endpoint branch July 25, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants