Skip to content

Commit

Permalink
fix(cmd/influx): improve CLI error returned on org-not-found
Browse files Browse the repository at this point in the history
  • Loading branch information
danxmoran committed Dec 18, 2020
1 parent 8e24128 commit b2cc85d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/influx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func (o *organization) getID(orgSVC influxdb.OrganizationService) (influxdb.ID,
if o.id != "" {
influxOrgID, err := influxdb.IDFromString(o.id)
if err != nil {
return 0, fmt.Errorf("invalid org ID '%s' provided: %w (did you pass an org name instead of an ID?)", o.id, err)
return 0, fmt.Errorf("invalid org ID '%s' provided (did you pass an org name instead of an ID?): %w", o.id, err)
}
return *influxOrgID, nil
}
Expand All @@ -525,7 +525,7 @@ func (o *organization) getID(orgSVC influxdb.OrganizationService) (influxdb.ID,
Name: &name,
})
if err != nil {
return 0, err
return 0, fmt.Errorf("failed to get ID for org '%s' (do you have org-level read permission?): %w", name, err)
}
return org.ID, nil
}
Expand Down

0 comments on commit b2cc85d

Please sign in to comment.