-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
ref: Add ruff rules TRY3xx #4098
base: main
Are you sure you want to change the base?
Conversation
64a77e7
to
f82c962
Compare
# This means the Flow ID is not a valid UUID which means it can't find the flow | ||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc)) from exc | ||
logger.exception(exc) | ||
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(exc)) from exc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this exception was missing in StatementError
's handling
except Exception as e: | ||
if "No result found" in str(e): | ||
raise HTTPException(status_code=404, detail="Folder not found") from e | ||
raise HTTPException(status_code=500, detail=str(e)) from e | ||
|
||
if not folder: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this was missing
@@ -203,12 +214,17 @@ async def download_file( | |||
): | |||
"""Download all flows from folder.""" | |||
try: | |||
return session.exec(select(Folder).where(Folder.id == folder_id, Folder.user_id == current_user.id)).first() | |||
folder = session.exec(select(Folder).where(Folder.id == folder_id, Folder.user_id == current_user.id)).first() | |||
except Exception as e: | |||
if "No result found" in str(e): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how this can happen...
Add ruff rules TRY3xx
TRY301 issues are fixed but not enforcing them atm as they are a bit hard to grok.