Skip to content

Commit

Permalink
fix(cmd/get): must catch DatasetRequest error
Browse files Browse the repository at this point in the history
  • Loading branch information
ramfox committed Apr 23, 2019
1 parent 2239c35 commit f200acc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ func (o *GetOptions) Complete(f Factory, args []string) (err error) {
}
}
o.Refs = args
o.DatasetRequests, err = f.DatasetRequests()
if o.DatasetRequests, err = f.DatasetRequests(); err != nil {
return
}

if o.Selector == "body" {
// if we have a limit, but not offset, assume an offset of 0
Expand Down
4 changes: 3 additions & 1 deletion cmd/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ type PublishOptions struct {
// Complete adds any missing configuration that can only be added just before calling Run
func (o *PublishOptions) Complete(f Factory, args []string) (err error) {
o.Refs = args
o.DatasetRequests, err = f.DatasetRequests()
if o.DatasetRequests, err = f.DatasetRequests(); err != nil {
return err
}
o.RemoteRequests, err = f.RemoteRequests()
return
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ type RemoveOptions struct {
// Complete adds any missing configuration that can only be added just before calling Run
func (o *RemoveOptions) Complete(f Factory, args []string) (err error) {
o.Args = args
o.DatasetRequests, err = f.DatasetRequests()
if err != nil {
if o.DatasetRequests, err = f.DatasetRequests(); err != nil {
return err
}
if o.All {
Expand Down

0 comments on commit f200acc

Please sign in to comment.