mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
add error stack for internal error printing
This commit is contained in:
@ -317,7 +317,7 @@ func (c *Core) RowsToResult(ctx context.Context, rows *sql.Rows) (Result, error)
|
||||
}
|
||||
defer func() {
|
||||
if err := rows.Close(); err != nil {
|
||||
intlog.Error(ctx, err)
|
||||
intlog.Errorf(ctx, `%+v`, err)
|
||||
}
|
||||
}()
|
||||
if !rows.Next() {
|
||||
|
||||
@ -49,7 +49,7 @@ func (m *Model) checkAndRemoveCache() {
|
||||
ctx := m.GetCtx()
|
||||
_, err := m.db.GetCache().Remove(ctx, m.cacheOption.Name)
|
||||
if err != nil {
|
||||
intlog.Error(ctx, err)
|
||||
intlog.Errorf(ctx, `%+v`, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -536,7 +536,7 @@ func (m *Model) doGetAllBySql(sql string, args ...interface{}) (result Result, e
|
||||
if cacheKey != "" && err == nil {
|
||||
if m.cacheOption.Duration < 0 {
|
||||
if _, err := cacheObj.Remove(ctx, cacheKey); err != nil {
|
||||
intlog.Error(m.GetCtx(), err)
|
||||
intlog.Errorf(m.GetCtx(), `%+v`, err)
|
||||
}
|
||||
} else {
|
||||
// In case of Cache Penetration.
|
||||
@ -544,7 +544,7 @@ func (m *Model) doGetAllBySql(sql string, args ...interface{}) (result Result, e
|
||||
result = Result{}
|
||||
}
|
||||
if err := cacheObj.Set(ctx, cacheKey, result, m.cacheOption.Duration); err != nil {
|
||||
intlog.Error(m.GetCtx(), err)
|
||||
intlog.Errorf(m.GetCtx(), `%+v`, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user