diff options
-rw-r--r-- | cmd/rescribe/getembeds.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/rescribe/getembeds.go b/cmd/rescribe/getembeds.go index fb93d48..b9b59ae 100644 --- a/cmd/rescribe/getembeds.go +++ b/cmd/rescribe/getembeds.go @@ -34,6 +34,9 @@ func dl(url string) error { return fmt.Errorf("Error getting url %s: %v", url, err) } defer r.Body.Close() + if r.StatusCode != 200 { + return fmt.Errorf("Error getting url %s: got code %v", url, r.StatusCode) + } _, err = io.Copy(f, r.Body) if err != nil { @@ -105,7 +108,7 @@ func main() { } if !present(v.url, v.sum) { - fmt.Fprintf(os.Stderr, "Error: downloaded %s does not match expected checksum: %v\n", v.url, v.sum, err) + fmt.Fprintf(os.Stderr, "Error: downloaded %s does not match expected checksum\n", v.url) os.Exit(1) } } |