From e34a26c009e41687639fb5bf24180857e38ab28b Mon Sep 17 00:00:00 2001 From: lishuang Date: Sat, 22 Jul 2023 15:45:07 +0800 Subject: [PATCH] fix: fix the status code hint bug. --- code/rest/matter_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/rest/matter_service.go b/code/rest/matter_service.go index 2363c62..5670950 100644 --- a/code/rest/matter_service.go +++ b/code/rest/matter_service.go @@ -1241,6 +1241,10 @@ func (this *MatterService) AtomicCrawl(request *http.Request, url string, filena //download from url. resp, err := http.Get(url) this.PanicError(err) + //if resp is not ok. + if resp.StatusCode != 200 { + panic(result.BadRequest("error when crawl from url.")) + } return this.Upload(request, resp.Body, nil, user, space, dirMatter, filename, privacy) }