Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Add better error handling for PullImage #49

Merged
merged 1 commit into from
Jan 9, 2015

Conversation

donhcd
Copy link
Collaborator

@donhcd donhcd commented Dec 2, 2014

No description provided.

@donhcd
Copy link
Collaborator Author

donhcd commented Dec 16, 2014

ping @vieux @aluzzardi I added a test (partly copied from #57), and also I improved the response reading by using bufio.Scanner

}
defer resp.Body.Close()
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
Copy link

Choose a reason for hiding this comment

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

@donhcd Do we really need to un-marshal every single line of response? I have always seen the error message to be on the last line of the response if the pull terminates with an error.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you're right, the last line will have the error if there is one: https://github.com/docker/docker/blob/487a417d9fd074d0e78876072c7d1ebfd398ea7a/api/server/server.go#L518
I'll go ahead and make this change

@vieux
Copy link
Contributor

vieux commented Jan 9, 2015

LGTM

vieux added a commit that referenced this pull request Jan 9, 2015
Add better error handling for PullImage
@vieux vieux merged commit c288320 into samalba:master Jan 9, 2015
@donhcd donhcd deleted the betterPullError branch January 9, 2015 22:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants