[#1969] local_object_storage: Add a type for logical errors

All logic errors are wrapped in `logicerr.Logical` type and do not
affect shard error counter.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-10-26 15:23:12 +03:00 committed by fyrchik
parent 98034005f1
commit fcdbf5e509
42 changed files with 206 additions and 139 deletions

View file

@ -6,10 +6,11 @@ import (
"time"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard/mode"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/util/logicerr"
)
// ErrReadOnly is returned when Put/Write is performed in a read-only mode.
var ErrReadOnly = errors.New("write-cache is in read-only mode")
var ErrReadOnly = logicerr.Wrap(errors.New("write-cache is in read-only mode"))
// SetMode sets write-cache mode of operation.
// When shard is put in read-only mode all objects in memory are flushed to disk