From 5dc767239ab25b78adb6a0f01f96be78e16cad90 Mon Sep 17 00:00:00 2001 From: godcong Date: Fri, 11 Oct 2019 13:38:19 +0800 Subject: [PATCH] update scrape --- scrape.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scrape.go b/scrape.go index 3df7f21..9a2fac7 100644 --- a/scrape.go +++ b/scrape.go @@ -2,6 +2,7 @@ package scrape import ( "encoding/json" + "fmt" "io" "os" "path/filepath" @@ -76,10 +77,14 @@ func (impl *scrapeImpl) Find(name string) (msg *[]*Content, e error) { } e = iGrab.Decode(msg) if e != nil { - log.With("name", grab.Name(), "find", name).Error(e) + log.With("name", grab.Name(), "decode", name).Error(e) } } + if len(*msg) == 0 { + return nil, fmt.Errorf("[%s] not found", name) + } + if impl.cache != nil { e := imageCache(impl.cache, *msg) if e != nil {