Skip to content
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

[3.1.7 backport] Reword missing collection error #6880

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion rest/admin_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (h *handler) handleCreateDB() error {
return httpErr
}
if errors.Is(err, base.ErrAuthError) {
return base.HTTPErrorf(http.StatusForbidden, "Provided credentials do not have access to specified bucket/scope/collection")
return base.HTTPErrorf(http.StatusForbidden, "The specified bucket/scope/collection does not exist, or the provided credentials do not have access to it")
}
if errors.Is(err, base.ErrAlreadyExists) {
return base.HTTPErrorf(http.StatusConflict, "couldn't load database: %s", err)
Expand Down
4 changes: 2 additions & 2 deletions rest/adminapitest/admin_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3612,10 +3612,10 @@ func TestCreateDbOnNonExistentBucket(t *testing.T) {

resp := rest.BootstrapAdminRequest(t, http.MethodPut, "/db/", `{"bucket": "nonexistentbucket"}`)
resp.RequireStatus(http.StatusForbidden)
assert.Contains(t, resp.Body, "Provided credentials do not have access to specified bucket/scope/collection")
assert.Contains(t, resp.Body, "The specified bucket/scope/collection does not exist, or the provided credentials do not have access to it")
resp = rest.BootstrapAdminRequest(t, http.MethodPut, "/nonexistentbucket/", `{}`)
resp.RequireStatus(http.StatusForbidden)
assert.Contains(t, resp.Body, "Provided credentials do not have access to specified bucket/scope/collection")
assert.Contains(t, resp.Body, "The specified bucket/scope/collection does not exist, or the provided credentials do not have access to it")
}

func TestPutDbConfigChangeName(t *testing.T) {
Expand Down
Loading