Closed metarsit-nutonomy closed 3 years ago
@kyoungho Do you think this will be possible? This will start to be a problem for us if the error returns is not well handled.
@metarsit I think error checking for the cgo functions (C.CString) is possible. According to this (https://golang.org/cmd/cgo/#hdr-Go_references_to_C), it looks like C.CString uses malloc and it would return null if it fails. I think we can check a return value is null or not.
Regarding Connector C functions for setting and getting values, they do not return errors. Our Connector team is currently working on this. I will keep you updated through this issue report.
@kyoungho Thank you! Do you know the timeline on that? If it will take sometime, I might implement some work around.
@metarsit Sure! I believe the fix will be included in our next Connector release and our target date is around November. The RTI issue ID for this is CON-77. Meanwhile, I can fix the error handling for the cgo part. Then, I will fix the Connector part after the release.
@kyoungho That's great! I am looking forward to it! If there is anything you need my help with please let me know! I can help to review if that's necessary.
@metarsit Sounds good! It would be great if you can review.
@kyoungho Hit me up or assign me as reviewer whenever! :)
@metarsit Will do!
@metarsit-nutonomy Finally, I had a chance to add error checking. The function definitions in the C library were updated to support this, so I updated them in the header accordingly. Can you review my commit when you have time? Thanks!
@kyoungho Can you refer me to the commit? I will review it.
@metarsit Sure! I believe the fix will be included in our next Connector release and our target date is around November. The RTI issue ID for this is CON-77. Meanwhile, I can fix the error handling for the cgo part. Then, I will fix the Connector part after the release.
Do you know whether this is still on track?
Yes, it is in the develop branch. I should merge it once you review. Please see the following commit. https://github.com/rticommunity/rticonnextdds-connector-go/commit/3aefbe68a0dbfa0b5a295f7d04adcdf0b0480a9c
Okay. A few things. I have been making changes to master
, so develop
is pretty out of date.
I think if we want develop to be the playground, we should make develop
the default branch so we make our changes in there. And once it is releasable, you merge it to master
and tag it.
I am suggesting we rebasing develop (which might cause conflict to many people) but its for the better.
Please fix the conflict and I will review the commit again, it is quite different from master
now.
I resolved the conflicts and created a PR to merge develop to master. I tagged the current master version with v0.3 and will tag the merged one with v0.4 after the merge is complete. Please review the PR. Thanks!
https://github.com/rticommunity/rticonnextdds-connector-go/pull/37
Proposal:
Return proper error of C library
Current behavior:
Currently we do not return anything else other than
nil
Desired behavior:
Return actual error if C library does not work
Use case:
Without returning proper errors, it will potentially be a problem with error handling as we will never know whether that instance.Set() fails.