From f4535004c2dc54139cb2f16ece26271ba76ccb58 Mon Sep 17 00:00:00 2001 From: ffalor <35144141+ffalor@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:35:56 -0500 Subject: [PATCH] clearer error message --- pkg/cmd/project/shared/queries/queries.go | 4 ++-- pkg/cmd/project/shared/queries/queries_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/project/shared/queries/queries.go b/pkg/cmd/project/shared/queries/queries.go index 0bf96ba63..c1c518848 100644 --- a/pkg/cmd/project/shared/queries/queries.go +++ b/pkg/cmd/project/shared/queries/queries.go @@ -1001,7 +1001,7 @@ type Owner struct { // NewOwner creates a project Owner // If canPrompt is false, login is required as we cannot prompt for it. // If login is not empty, it is used to lookup the project owner. -// If login is empty empty, interative mode is used to select an owner. +// If login is empty, interative mode is used to select an owner. // from the current viewer and their organizations func (c *Client) NewOwner(canPrompt bool, login string) (*Owner, error) { if login != "" { @@ -1018,7 +1018,7 @@ func (c *Client) NewOwner(canPrompt bool, login string) (*Owner, error) { } if !canPrompt { - return nil, fmt.Errorf("login is required when not running interactively") + return nil, fmt.Errorf("owner is required when not running interactively") } logins, err := c.userOrgLogins() diff --git a/pkg/cmd/project/shared/queries/queries_test.go b/pkg/cmd/project/shared/queries/queries_test.go index e1cf8c68b..5767929a3 100644 --- a/pkg/cmd/project/shared/queries/queries_test.go +++ b/pkg/cmd/project/shared/queries/queries_test.go @@ -361,7 +361,7 @@ func TestNewProject_nonTTY(t *testing.T) { func TestNewOwner_nonTTY(t *testing.T) { client := NewTestClient() _, err := client.NewOwner(false, "") - assert.EqualError(t, err, "login is required when not running interactively") + assert.EqualError(t, err, "owner is required when not running interactively") }