shipyard/shipyard-agent — pull request #39 by tmrudick (2014-06-30 23:27:03+00:00)
Title: Rely on the HTTP status code for error handling

Fixes https://github.com/shipyard/shipyard/issues/195

When we try to get logs without streaming, the underlying HTTP connection is prematurely closed. However, the response is still returned intact. Instead of checking the `err` variable, we can check the status code of the response to determine an error state. It will be an error if we get a greater than 200-level error code. 204 is the highest 200-level status code that the 1.9 API returns which is why I am checking against http.StatusNoContent.

Testing this change *appears* to not have a negative result (can still create containers, delete images, etc). Although there are no hard tests. Thoughts?

**NOTE**: This is my first time writing Go. Although it is a small change, please give any style or convention feedback!