diff options
Diffstat (limited to 'skate')
-rw-r--r-- | skate/cdx.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/skate/cdx.go b/skate/cdx.go index ed394ed..6378bf6 100644 --- a/skate/cdx.go +++ b/skate/cdx.go @@ -105,6 +105,9 @@ func LookupCDX(link string) (result CDX, b []byte, err error) { return nil, b, err } defer resp.Body.Close() + if resp.StatusCode >= 400 { + return nil, nil, fmt.Errorf("api returned HTTP %v", resp.StatusCode) + } b, err = ioutil.ReadAll(resp.Body) if err != nil { return nil, b, err |