Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit: display authentication and network errors with code lenses (#5545)
Close https://linear.app/sourcegraph/issue/CODY-251/bug-no-visual-indication-in-editor-when-a-users-access-token-is-no The original issue in the linked issue has been issue, but Dom mentioned the code lenses right now are just displaying "Applying Edit Fails" on authentication error. This PR adds an if statement to display "Authentication Failed" when an authentication error occurs or "Network Disconnected" when a network error occurs during Edits. This change adds handling for authentication errors in the codelenses, displaying a "Authentication Failed" message and providing a command to sign in. Additionally, the "Show Rate Limit Modal" command has been removed from the package.json as this is a utils command that should not be registered for users to use. ## Test plan <!-- Required. See https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles. --> I'm not sure how to replicate an auth error, but to test the Network error, you can start Cody from this branch in the debugger, and then turn off your Wi-Fi connection before running the Document Command: ![image](https://github.com/user-attachments/assets/b5b86f84-b866-4c2c-a589-40ff18e091e8) ### Before You will see a codelens with "Applying Edit Failed" without any details into the error: ![image](https://github.com/user-attachments/assets/09453885-ba3e-4bd0-81d5-54fb476e00be) ## Changelog <!-- OPTIONAL; info at https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c --> Edit: display authentication and network errors with code lenses --------- Co-authored-by: James McNamara <[email protected]>
- Loading branch information