Add logs for func saveStruct.
This commit is contained in:
parent
7c9d4c28dc
commit
19cbc17f35
10
save.go
10
save.go
|
@ -217,14 +217,20 @@ func saveStruct(
|
|||
row, _ = dataItem.Addr().Interface().(meta.IMetaStruct)
|
||||
}
|
||||
if row == nil {
|
||||
return errors.Errorf("Couldn't convert to IMetaStruct: %s", mType.Name())
|
||||
err := errors.Errorf("Couldn't convert to IMetaStruct: %s", mType.Name())
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
props := *row.CLASS_PROPS()
|
||||
if ownerField, ok := props["owner"]; ok {
|
||||
field := dataItem.FieldByName(strings.Title(ownerField))
|
||||
if !field.IsValid() {
|
||||
return errors.Errorf("Owner field \"%s\" is not found in struct \"%s\"", ownerField, mType.Name())
|
||||
err := errors.Errorf("Owner field \"%s\" is not found in struct \"%s\"", ownerField, mType.Name())
|
||||
span.RecordError(err)
|
||||
span.SetStatus(codes.Error, err.Error())
|
||||
return err
|
||||
}
|
||||
|
||||
// enforcing ownerId
|
||||
|
|
Loading…
Reference in New Issue