Merge pull request #8235 from ffalor/issue_8218

clearer error message
This commit is contained in:
William Martin 2023-10-23 19:12:32 +02:00 committed by GitHub
commit 08bc4cbb5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -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()

View file

@ -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")
}