Skip to content

Coder plugin: clean up error-handling logic #134

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

Open
Parkreiner opened this issue Jun 3, 2024 · 0 comments
Open

Coder plugin: clean up error-handling logic #134

Parkreiner opened this issue Jun 3, 2024 · 0 comments
Labels
bug Something isn't working good first issue Issues suitable for community contributors and new Coder employees

Comments

@Parkreiner
Copy link
Member

The Coder plugin has some vestigial code from before we started using Axios. Now that we have Axios's AxiosError, there's far less of a need for the custom BackstageHttpError

In addition, the logic for spying on potentially-expired Coder session tokens can be cleaned up. The current code works, but when a Coder query fails, the plugin will make an entirely brand new request to revalidate the auth state. But if the error has a 401 status, we don't need to do that – we know that the session token is likely invalid, so we can mutate the query cache directly.

Tried to get these fixed really quickly in #132, but it started making the tests fail, so I decided to split this off into a separate issue.

@coder-labeler coder-labeler bot added the bug Something isn't working label Jun 3, 2024
@Parkreiner Parkreiner added the good first issue Issues suitable for community contributors and new Coder employees label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Issues suitable for community contributors and new Coder employees
Projects
None yet
Development

No branches or pull requests

1 participant