From 776a6062dbea45d89f24fc09680405258d59c8ba Mon Sep 17 00:00:00 2001 From: debuggerx Date: Sun, 22 Nov 2020 00:57:24 +0800 Subject: [PATCH] skip error --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 528236f..9313fc5 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,9 @@ func wepb2jpg(path string, md5Path string, writer http.ResponseWriter) { resp, getErr := http.Get(path) if getErr != nil { - log.Fatal(getErr) + log.Print(getErr) + writer.WriteHeader(404) + return } endTime := time.Now().UnixNano() @@ -108,6 +110,5 @@ func wepb2jpgHandler(writer http.ResponseWriter, request *http.Request) { if hitCache(md5Path, writer) { return } - wepb2jpg(request.URL.RawQuery, md5Path, writer) }