From 308c9e959c23b3091ce5122c0828b7db35dd9b1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Mon, 19 Sep 2022 11:27:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(park):=E4=BF=AE=E6=AD=A3=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/park.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/service/park.go b/service/park.go index 992fa86..af79765 100644 --- a/service/park.go +++ b/service/park.go @@ -130,10 +130,7 @@ func (_ParkService) FetchParkDetail(pid string) (*model.Park, error) { Where("id = ?", pid). Scan(ctx) if err != nil { - return nil, err - } - if park == nil { - return nil, exceptions.NewNotFoundError("未找到符合条件的园区记录。") + return nil, exceptions.NewNotFoundErrorFromError("未找到符合条件的园区记录。", err) } cache.CacheEntity(*park, []string{fmt.Sprintf("park:%s", pid)}, "park", pid) return park, nil