From e8167e7a4c65219f59959135221f13258e9b7137 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 1 Sep 2023 14:09:38 +0800 Subject: [PATCH] fix --- server/info/internal/logic/infologic.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/info/internal/logic/infologic.go b/server/info/internal/logic/infologic.go index 79432e86..385860f4 100644 --- a/server/info/internal/logic/infologic.go +++ b/server/info/internal/logic/infologic.go @@ -118,8 +118,14 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r sqlstr := fmt.Sprintf("select id, module, %s as querydata from %s where %s ", mquery.EncodeQuery("metadata"), mquery.TableName, cond) var info InfoType raw := l.svcCtx.MysqlConn.Raw(sqlstr) - if raw.Error == gorm.ErrRecordNotFound { - continue + + if raw.Error != nil { + if raw.Error == gorm.ErrRecordNotFound { + continue + } else { + logx.Error(raw.Error) + return resp.SetStatusWithMessage(basic.CodeApiErr, raw.Error.Error()) + } } err := raw.Scan(&info).Error