From df1460aa69a85d23a42a81d6ca3108ff6dfaf6f6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 7 Jun 2019 09:38:27 -0700 Subject: [PATCH] only return wget on 200 Signed-off-by: Jeff Carr --- wget.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wget.go b/wget.go index 04e82d3..a2317c4 100644 --- a/wget.go +++ b/wget.go @@ -35,8 +35,8 @@ func Wget(url string) (*bytes.Buffer) { defer resp.Body.Close() log.Printf("res.StatusCode: %d\n", resp.StatusCode) - if (resp.StatusCode == 404) { - handleError(fmt.Errorf("404"), -1) + if (resp.StatusCode != 200) { + handleError(fmt.Errorf(fmt.Sprint("%d", resp.StatusCode)), -1) return nil }