diff options
| -rw-r--r-- | internal/links/fetch.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/links/fetch.go b/internal/links/fetch.go index 864d754..53cc692 100644 --- a/internal/links/fetch.go +++ b/internal/links/fetch.go @@ -24,5 +24,9 @@ func fetch(rawURL string, timeoutSecs int) (io.Reader, error) { } defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("status for %s for %s: %s", http.MethodGet, rawURL, resp.Status) + } + return bufio.NewReader(resp.Body), nil } |
