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