Skip to content

feat: Return more 404s vs 403s #2194

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 16 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test assert
  • Loading branch information
Emyrk committed Jun 10, 2022
commit 8bfe1f7dfdc2e8697d11245c9e2dc60e4a8b23f5
2 changes: 1 addition & 1 deletion coderd/httpapi/httpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type Error struct {
// to prevent leaking existence of resources.
func ResourceNotFound(rw http.ResponseWriter) {
Write(rw, http.StatusNotFound, Response{
Message: fmt.Sprintf("Resource not found"),
Message: "Resource not found",
})
}

Expand Down
2 changes: 1 addition & 1 deletion coderd/workspacebuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestWorkspaceBuildByBuildNumber(t *testing.T) {
var apiError *codersdk.Error
require.ErrorAs(t, err, &apiError)
require.Equal(t, http.StatusNotFound, apiError.StatusCode())
require.ErrorContains(t, apiError, "Workspace \"workspaceName\" does not exist.")
require.ErrorContains(t, apiError, "Resource not found")
})

t.Run("WorkspaceBuildNotFound", func(t *testing.T) {
Expand Down