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
Tim Voronov 2baac62d1e
Bugfix/#559 html escaping (#573)
Added jettison for json encoding
2020-11-23 20:12:04 -05:00

22 lines
450 B
Go

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)
}
}
}