Skip to content

Commit

Permalink
Merge pull request #8235 from ffalor/issue_8218
Browse files Browse the repository at this point in the history
clearer error message
  • Loading branch information
williammartin committed Oct 23, 2023
2 parents 5023b61 + f453500 commit 08bc4cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/project/shared/queries/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/project/shared/queries/queries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}

Expand Down

0 comments on commit 08bc4cb

Please sign in to comment.