More tests for errors

[finishes #104040604]

Signed-off-by: Chris Sun <lsun@pivotal.io>
This commit is contained in:
Evan Short
2015-10-21 15:04:44 -07:00
committed by Chris Sun
parent 95ab1bda22
commit e3a3a53dba
2 changed files with 149 additions and 116 deletions

View File

@@ -158,7 +158,7 @@ func (c *InCommand) downloadFile(url, destPath string) error {
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("failed to download file: HTTP status %d: %s", resp.StatusCode, resp.Status)
return fmt.Errorf("failed to download file `%s`: HTTP status %d", filepath.Base(destPath), resp.StatusCode)
}
_, err = io.Copy(out, resp.Body)