summaryrefslogtreecommitdiff
path: root/cmd/rescribe/getembeds.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-02-28 17:21:27 +0000
committerNick White <git@njw.name>2022-02-28 17:21:27 +0000
commitfe9fd2e460762f60c1887b07727e6dd6668970a8 (patch)
tree6f225b008888c412336d44b48932433a92f19377 /cmd/rescribe/getembeds.go
parent7ebcab53b0e8e90dca1ed024e4d815529d49fd09 (diff)
rescribe: Further improve getembeds error reporting and recognition
Diffstat (limited to 'cmd/rescribe/getembeds.go')
-rw-r--r--cmd/rescribe/getembeds.go5
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)
}
}