Fix temporal persistence wiring and restore slurp_full suite
This commit is contained in:
8
pkg/slurp/storage/errors.go
Normal file
8
pkg/slurp/storage/errors.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package storage
|
||||
|
||||
import "errors"
|
||||
|
||||
// ErrNotFound indicates that the requested context does not exist in storage.
|
||||
// Tests and higher-level components rely on this sentinel for consistent handling
|
||||
// across local, distributed, and encrypted backends.
|
||||
var ErrNotFound = errors.New("storage: not found")
|
||||
@@ -201,7 +201,7 @@ func (ls *LocalStorageImpl) Retrieve(ctx context.Context, key string) (interface
|
||||
entryBytes, err := ls.db.Get([]byte(key), nil)
|
||||
if err != nil {
|
||||
if err == leveldb.ErrNotFound {
|
||||
return nil, fmt.Errorf("key not found: %s", key)
|
||||
return nil, fmt.Errorf("%w: %s", ErrNotFound, key)
|
||||
}
|
||||
return nil, fmt.Errorf("failed to retrieve data: %w", err)
|
||||
}
|
||||
@@ -328,7 +328,7 @@ func (ls *LocalStorageImpl) Size(ctx context.Context, key string) (int64, error)
|
||||
entryBytes, err := ls.db.Get([]byte(key), nil)
|
||||
if err != nil {
|
||||
if err == leveldb.ErrNotFound {
|
||||
return 0, fmt.Errorf("key not found: %s", key)
|
||||
return 0, fmt.Errorf("%w: %s", ErrNotFound, key)
|
||||
}
|
||||
return 0, fmt.Errorf("failed to get data size: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user