diff --git a/save.go b/save.go index 989cdc3..e88fe34 100644 --- a/save.go +++ b/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