Parcourir la source

improve error string

xormplus il y a 8 ans
Parent
commit
6d20d565e3
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      engine.go

+ 1 - 1
engine.go

@@ -958,7 +958,7 @@ func (engine *Engine) mapType(v reflect.Value) (*core.Table, error) {
 					}
 					}
 					if pStart > -1 {
 					if pStart > -1 {
 						if !strings.HasSuffix(k, ")") {
 						if !strings.HasSuffix(k, ")") {
-							return nil, errors.New("cannot match ) charactor")
+							return nil, fmt.Errorf("field %s tag %s cannot match ) charactor", col.FieldName, key)
 						}
 						}
 
 
 						ctx.tagName = k[:pStart]
 						ctx.tagName = k[:pStart]