forked from TrueCloudLab/frostfs-node
[#1568] storage: Remove "could not/can't/failed to" from error messages
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
e44b84c18c
commit
bd0197eaa8
39 changed files with 128 additions and 128 deletions
|
@ -30,7 +30,7 @@ func IterateDB(db *bbolt.DB, f func(oid.Address) error) error {
|
|||
return b.ForEach(func(k, _ []byte) error {
|
||||
err := addr.DecodeString(string(k))
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not parse object address: %w", err)
|
||||
return fmt.Errorf("parse object address: %w", err)
|
||||
}
|
||||
|
||||
return f(addr)
|
||||
|
|
|
@ -83,7 +83,7 @@ func (c *cache) closeStorage(ctx context.Context, shrink bool) error {
|
|||
}
|
||||
if !shrink {
|
||||
if err := c.fsTree.Close(ctx); err != nil {
|
||||
return fmt.Errorf("can't close write-cache storage: %w", err)
|
||||
return fmt.Errorf("close write-cache storage: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -98,16 +98,16 @@ func (c *cache) closeStorage(ctx context.Context, shrink bool) error {
|
|||
if errors.Is(err, errIterationCompleted) {
|
||||
empty = false
|
||||
} else {
|
||||
return fmt.Errorf("failed to check write-cache items: %w", err)
|
||||
return fmt.Errorf("check write-cache items: %w", err)
|
||||
}
|
||||
}
|
||||
if err := c.fsTree.Close(ctx); err != nil {
|
||||
return fmt.Errorf("can't close write-cache storage: %w", err)
|
||||
return fmt.Errorf("close write-cache storage: %w", err)
|
||||
}
|
||||
if empty {
|
||||
err := os.RemoveAll(c.path)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return fmt.Errorf("failed to remove write-cache files: %w", err)
|
||||
return fmt.Errorf("remove write-cache files: %w", err)
|
||||
}
|
||||
} else {
|
||||
c.log.Info(ctx, logs.WritecacheShrinkSkippedNotEmpty)
|
||||
|
|
|
@ -31,10 +31,10 @@ func (c *cache) openStore(mod mode.ComponentMode) error {
|
|||
fstree.WithFileCounter(c.counter),
|
||||
)
|
||||
if err := c.fsTree.Open(mod); err != nil {
|
||||
return fmt.Errorf("could not open FSTree: %w", err)
|
||||
return fmt.Errorf("open FSTree: %w", err)
|
||||
}
|
||||
if err := c.fsTree.Init(); err != nil {
|
||||
return fmt.Errorf("could not init FSTree: %w", err)
|
||||
return fmt.Errorf("init FSTree: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -25,11 +25,11 @@ func (c *cache) flushAndDropBBoltDB(ctx context.Context) error {
|
|||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not check write-cache database existence: %w", err)
|
||||
return fmt.Errorf("check write-cache database existence: %w", err)
|
||||
}
|
||||
db, err := OpenDB(c.path, true, os.OpenFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not open write-cache database: %w", err)
|
||||
return fmt.Errorf("open write-cache database: %w", err)
|
||||
}
|
||||
defer func() {
|
||||
_ = db.Close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue