Skip to content

fix: avoid returning 500 on apps when workspace stopped #11656

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

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Jan 17, 2024

Currently we return a 500 error when trying to access workspace apps when a workspace is in the stopped state. This is mainly because we weren't wrapping sql.ErrNoRows when no workspace agents are returned. In such cases we want to return a 404 which makes sense since we can't find the agent we want to route it to; however, this is more an implementation detail and would be confusing to the user in the majority of cases where the agents are "destroyed" due to terraform. I added a 400 for the case where the workspace is stopped to help the error be a bit more informative to the user.

fixes #11106

Screenshot 2024-01-16 at 6 52 20 PM

@sreya sreya requested a review from Emyrk January 17, 2024 00:57
Copy link
Member

@Emyrk Emyrk left a comment

Choose a reason for hiding this comment

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

nice 👍

@sreya sreya merged commit 552e9fe into main Jan 17, 2024
@sreya sreya deleted the jon/stoppedapps branch January 17, 2024 18:07
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/apps/{workspaceapp}/* route being hit after workspace is stopped
2 participants