Export error types for No Data and Timeout return codes
Reason
In calling code it is often needed to handle timeouts and no-data errors differently to other core errors as these errors can occur as part of a normal connection process.
Testing the error string in the calling code relies on internal knowledge of the library and could be broken by a future update. Exporting the error types allows the error text to change in the future. It also makes testing for the error simple, for example:
import (
rti "github.com/rticommunity/rticonnextdds-connector-go"
)
...
if errors.Is(err, rti.ErrNoData) {
// Handle no data
}
This change also corrects a typo in one error string "Exceptrion" which could make it a breaking change if anyone currently relies on string matching.
This change was authored by my colleague @mwak2 who is no longer with the company.
Changes
No Data
andTimeout
return codesReason
In calling code it is often needed to handle timeouts and no-data errors differently to other core errors as these errors can occur as part of a normal connection process.
Testing the error string in the calling code relies on internal knowledge of the library and could be broken by a future update. Exporting the error types allows the error text to change in the future. It also makes testing for the error simple, for example:
This change also corrects a typo in one error string "Exceptrion" which could make it a breaking change if anyone currently relies on string matching.
This change was authored by my colleague @mwak2 who is no longer with the company.