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(Shared Links): Handling Shared Link Errors #3118

Merged

Conversation

ohneda
Copy link
Contributor

@ohneda ohneda commented Jun 19, 2024

Summary

Resolved an issue where the client would not display an error message when the API encountered an error while creating or updating a shared link.

ref: #2772 (comment)

Details

Added the error handling for shared link operations:

  • Implemented error message display on the client side when the API returns an error.
  • Modified the backend to return HTTP status code 500 when an error occurs during processing.

SCR-20240619-lbbn

SCR-20240619-lbbn

This PR includes exception handling in both the model and the router. However, it might be more appropriate to handle exceptions only in the router and not in the model. Please let me know if any adjustments are needed to maintain consistency with other parts of the codebase.

Change Type

  • Bug fix
  • Translation update

Testing

Manually verified the following scenarios:

  • When creating a shared link, an error message is displayed if the API returns a 4xx or 5xx error.
  • When updating a shared link, an error message is displayed if the API returns a 4xx or 5xx error.
  • When deleting a shared link, an error message is displayed if the API returns a 4xx or 5xx error.
  • When displaying the list of shared links, an error message is displayed if the API returns a 4xx or 5xx error.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

@danny-avila danny-avila merged commit 4e4de88 into danny-avila:main Jun 21, 2024
3 checks passed
@ohneda ohneda deleted the refactor/handling-shared-link-error branch June 21, 2024 17:08
danny-avila added a commit that referenced this pull request Aug 5, 2024
* refactor: add error handling in Share model

* refactor: add error handing to API routers

* refactor: display error message when API response is an error

* chore: remove unneccesary JSON.stringify

* chore: revert unintended changes

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
kenshinsamue pushed a commit to intelequia/LibreChat that referenced this pull request Sep 17, 2024
* refactor: add error handling in Share model

* refactor: add error handing to API routers

* refactor: display error message when API response is an error

* chore: remove unneccesary JSON.stringify

* chore: revert unintended changes

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
BertKiv pushed a commit to BertKiv/LibreChat that referenced this pull request Dec 10, 2024
* refactor: add error handling in Share model

* refactor: add error handing to API routers

* refactor: display error message when API response is an error

* chore: remove unneccesary JSON.stringify

* chore: revert unintended changes

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
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.

2 participants