Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ func newDownload(flags *pflag.FlagSet, usrCfg *viper.Viper) (*download, error) {
if err := json.NewDecoder(res.Body).Decode(&d.payload); err != nil {
return nil, decodedAPIError(res)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we have the decodedAPIError twice, which seems like it shouldn't be necessary.

I'm sorry if I'm being dumb, here. I'll take some time after work to pull this down and play around with it to see if I understand it better.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I played with this and I totally see what's going on.

Sorry for being slow!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, just glad I can help!

}
if d.payload.Error.Message != "" {
return nil, errors.New(d.payload.Error.Message)
}
Comment thread
Jrank2013 marked this conversation as resolved.

return d, nil
}
Expand Down