优化KV存储数据表关闭后的错误提示

This commit is contained in:
GoEdgeLab
2024-04-07 14:55:12 +08:00
parent b772085ef2
commit a4f0df21ba
5 changed files with 70 additions and 2 deletions

View File

@@ -165,6 +165,10 @@ func (this *Query[T]) FieldOffset(fieldOffset []byte) *Query[T] {
//}
func (this *Query[T]) FindAll(fn IteratorFunc[T]) (err error) {
if this.table != nil && this.table.isClosed {
return NewTableClosedErr(this.table.name)
}
defer func() {
var panicErr = recover()
if panicErr != nil {