chore: correct 500 -> 404 on workspace agent mw (#11129)

* chore: correct 500 -> 404
This commit is contained in:
Steven Masley
2023-12-12 15:14:32 -06:00
committed by GitHub
parent 0181e036f6
commit dba0dfa859
6 changed files with 73 additions and 32 deletions

View File

@ -78,6 +78,10 @@ func (api *API) workspaceAgent(rw http.ResponseWriter, r *http.Request) {
return err
})
err := eg.Wait()
if httpapi.Is404Error(err) {
httpapi.ResourceNotFound(rw)
return
}
if err != nil {
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
Message: "Internal error fetching workspace agent.",