Add error logging to kvs package

This commit is contained in:
Tobie Morgan Hitchcock 2019-12-03 10:03:00 +00:00
parent 63cbb59bae
commit 9c101af74a

View file

@ -19,6 +19,7 @@ import (
"github.com/abcum/rixxdb"
"github.com/abcum/surreal/kvs"
"github.com/abcum/surreal/log"
)
type TX struct {
@ -28,6 +29,7 @@ type TX struct {
func one(res *rixxdb.KV, err error) (kvs.KV, error) {
if err != nil {
log.WithPrefix("kvs").Errorln(err)
return nil, &kvs.DBError{Err: err}
}
@ -38,6 +40,7 @@ func one(res *rixxdb.KV, err error) (kvs.KV, error) {
func many(res []*rixxdb.KV, err error) ([]kvs.KV, error) {
if err != nil {
log.WithPrefix("kvs").Errorln(err)
return nil, &kvs.DBError{Err: err}
}