-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push and Pull send progress steps to supplied block; pushing raises a…
…n error if unauthorized. * A block supplied to Image#push or Image.create will be called with the parsed hash of each json message streamed back from the server. * create and push now raise errors if an error response is returned from the server * The VCR example for creating an image was actually that of a 401 Unauthorized request. I faked data from a successful pull into the 'pushes_the_Image.yml' VCR record, and used the old version as the test case for an unauthorized call. I'm not quite sure how I should be handling exceptions in all this. First, I'm assuming it's fair to raise an exception if any response from the server shows an error -- but if there are known-harmless errors out there they will now be explody. Also, if an error condition occurs in the response_block, it is caught and re-thrown as an Excon error. So I'm throwing a generic error inside the block, then catching all excon errors and re-throwing only the ones I recognize (Unauthorized for push, Not Found for pull) as Docker errors.
- Loading branch information
Philip (flip) Kromer
committed
Nov 29, 2014
1 parent
eea96e9
commit 4dd8ad6
Showing
6 changed files
with
942 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
...en_the_Image_does_not_yet_exist_and_the_body_is_a_Hash/calls_back_to_a_supplied_block.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.