This commit is contained in:
techknowlogick
2021-02-28 18:08:33 -05:00
committed by GitHub
parent 030646eea4
commit 47f6a4ec3f
947 changed files with 26119 additions and 7062 deletions

View File

@ -1,6 +1,7 @@
package hscan
import (
"fmt"
"reflect"
"strings"
"sync"
@ -83,5 +84,10 @@ func (s StructValue) Scan(key string, value string) error {
if !ok {
return nil
}
return field.fn(s.value.Field(field.index), value)
if err := field.fn(s.value.Field(field.index), value); err != nil {
t := s.value.Type()
return fmt.Errorf("cannot scan redis.result %s into struct field %s.%s of type %s, error-%s",
value, t.Name(), t.Field(field.index).Name, t.Field(field.index).Type, err.Error())
}
return nil
}