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(sentry): some unhandled errors #894

Merged
merged 2 commits into from
Aug 8, 2023
Merged

fix(sentry): some unhandled errors #894

merged 2 commits into from
Aug 8, 2023

Conversation

StanGirard
Copy link
Collaborator

Fixed some unhandled errors in sentry

@StanGirard StanGirard temporarily deployed to preview August 8, 2023 15:15 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Aug 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Aug 8, 2023 3:15pm
quivrapp 🔄 Building (Inspect) Visit Preview Aug 8, 2023 3:15pm

@StanGirard StanGirard merged commit 9ba7241 into main Aug 8, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/backend/core/crawl/crawler.py

  1. The exception handling in the _crawl method could be improved. Instead of just printing the exception, it would be better to log it using a logger. This would allow for better tracking of errors and issues.

  2. The process method writes the content to a file without checking if the content is None. This could potentially lead to an error. It would be better to check if the content is None before writing it to a file.

Example:

if content:
    with open(temp_file_path, \"w\") as temp_file:
        temp_file.write(content)

Risk Level 3 - /home/runner/work/quivr/quivr/backend/core/llm/qa_base.py

  1. The generate_answer and generate_stream methods have a lot of duplicated code. This could be refactored into a separate method to improve readability and maintainability.

  2. The generate_stream method uses an async for loop to iterate over the callback. It would be better to handle exceptions in this loop to prevent the entire method from failing if an error occurs during iteration.

Example:

async for token in callback.aiter():
    try:
        # process token
    except Exception as e:
        # log exception

🐛📝🔄


Powered by Code Review GPT

StanGirard added a commit that referenced this pull request Sep 12, 2023
* fix(answers): fixed with self.qa not existing anymore

* fix(crawling): fixed when it bugs
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.

1 participant