diff --git a/txt.go b/txt.go index 020d2ac..ae9e52e 100644 --- a/txt.go +++ b/txt.go @@ -94,6 +94,9 @@ func grabImage(id, url string) error { if err != nil { return fmt.Errorf("Error downloading %q: %v", url, err) } + if r.StatusCode != http.StatusOK { + return fmt.Errorf("%q status code: %v", url, r.StatusCode) + } defer r.Body.Close() img, err = io.ReadAll(r.Body) if err != nil {