avoid dumping error pages into error messages

This commit is contained in:
Dave Bailey 2014-09-09 17:20:58 +00:00
parent c61bc58683
commit 5ec748dc5e

View File

@ -62,6 +62,9 @@ func (s *SourceURL) extractFromURL() error {
if err != nil {
return err
}
if resp.StatusCode != 200 {
return fmt.Errorf("%v: %v", s.url, resp.Status)
}
if len(data) == 0 {
return fmt.Errorf("zero-length data received from %v", s.url)
}