Skip to content

Commit

Permalink
[3.1.7 backport] Reword missing collection error (#6880)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Brooks <ben.brooks@couchbase.com>
  • Loading branch information
torcolvin and bbrks authored Jun 8, 2024
1 parent c531d4d commit 758f494
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 758f494

Please sign in to comment.