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

enhancement: better error handing for remote models when there's no internet connection #4252

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

urmauur
Copy link
Member

@urmauur urmauur commented Dec 9, 2024

Describe Your Changes

  1. Addition of defaultDesc Function:

    • A new function defaultDesc is added to encapsulate the logic for displaying a default error description along with a troubleshooting assistance link and modal.
  2. Updates in getErrorTitle Function:

    • The refactoring introduced the utilization of defaultDesc in case of an invalid API key error, providing a consistent error description format.
  3. New Error Handling Logic:

    • Within the default case of the getErrorTitle switch statement, there's a new conditional check to display a specific message if the content is "Failed to fetch" indicating no internet connection, otherwise, it falls back to showing the message text along with defaultDesc.
  4. Structural Changes:

    • Removal of redundant elements by integrating them within the defaultDesc function which is now reused in multiple places.
    • Adjustment of the margins in the outer div from mt-10 to my-6.

Overall, the code improvements enhance the modularity and reusability of the error message rendering logic while ensuring consistent troubleshooting assistance across different error scenarios.

Fixes Issues

CleanShot 2024-12-10 at 00 01 31
CleanShot 2024-12-10 at 00 01 34

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@urmauur urmauur added the type: enhancement Improves a current feature label Dec 9, 2024
@urmauur urmauur added this to the v0.5.12 milestone Dec 9, 2024
@urmauur urmauur requested a review from louis-menlo December 9, 2024 17:10
@urmauur urmauur self-assigned this Dec 9, 2024
Copy link
Contributor

@louis-menlo louis-menlo left a comment

Choose a reason for hiding this comment

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

LGTM

@urmauur urmauur force-pushed the enhance/failed-fetch branch from 7be7387 to 9b24683 Compare December 10, 2024 03:47
Copy link
Contributor

Barecheck - Code coverage report

Total: 68.88%

Your code coverage diff: 0.07% ▴

Uncovered files and lines
FileLines
web/containers/ErrorMessage/index.tsx66-67

@urmauur urmauur merged commit c15bb9e into dev Dec 10, 2024
9 checks passed
@urmauur urmauur deleted the enhance/failed-fetch branch December 10, 2024 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Improves a current feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enhancement: Better error handing for remote models when there's no internet connection
2 participants