1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-04-02 22:25:48 +02:00
ferret/pkg/drivers/common/errors.go

22 lines
449 B
Go
Raw Normal View History

package common
import (
"io"
"github.com/MontFerret/ferret/pkg/runtime/core"
"github.com/rs/zerolog"
)
var (
ErrReadOnly = core.Error(core.ErrInvalidOperation, "read only")
ErrInvalidPath = core.Error(core.ErrInvalidOperation, "invalid path")
)
func CloseAll(logger zerolog.Logger, closers []io.Closer, msg string) {
for _, closer := range closers {
if err := closer.Close(); err != nil {
logger.Error().Err(err).Msg(msg)
}
}
}