diff --git a/zqd/handlers_test.go b/zqd/handlers_test.go index 03a4458992..0525b3c6fc 100644 --- a/zqd/handlers_test.go +++ b/zqd/handlers_test.go @@ -305,13 +305,13 @@ func TestSpaceInvalidName(t *testing.T) { _, err := client.SpacePost(ctx, api.SpacePostRequest{Name: "𝚭𝚴𝚪 is.good"}) require.NoError(t, err) _, err = client.SpacePost(ctx, api.SpacePostRequest{Name: "𝚭𝚴𝚪/bad"}) - require.EqualError(t, err, "status code 400: invalid space name") + require.EqualError(t, err, "status code 400: name may not contain '/' or non-printable characters") }) t.Run("Put", func(t *testing.T) { sp, err := client.SpacePost(ctx, api.SpacePostRequest{Name: "𝚭𝚴𝚪1"}) require.NoError(t, err) err = client.SpacePut(ctx, sp.ID, api.SpacePutRequest{Name: "𝚭𝚴𝚪/2"}) - require.EqualError(t, err, "status code 400: invalid space name") + require.EqualError(t, err, "status code 400: name may not contain '/' or non-printable characters") }) } diff --git a/zqd/space/config.go b/zqd/space/config.go index 7bbaccb10b..f5dc258631 100644 --- a/zqd/space/config.go +++ b/zqd/space/config.go @@ -82,7 +82,7 @@ func validateName(names map[string]api.SpaceID, name string) error { return zqe.E(zqe.Invalid, "cannot set name to an empty string") } if !validSpaceName(name) { - return zqe.E(zqe.Invalid, "invalid space name") + return zqe.E(zqe.Invalid, "name may not contain '/' or non-printable characters") } if _, ok := names[name]; ok { return zqe.E(zqe.Conflict, "space with name '%s' already exists", name)