RTI Connext C# API  6.1.2
Error management

How DDS errors are notified as exceptions in the API.

How DDS errors are notified as exceptions in the API.

Most methods in the C# API report errors as exceptions associated with the standard DDS error codes.

The following table associates each DDS error code with an exception:

Error code Exception
DDS_RETCODE_OK (No exception)
DDS_RETCODE_ERROR Omg.Dds.Core.DdsException
DDS_RETCODE_NO_DATA (No exception, usually an empty collection is returned)
DDS_RETCODE_BAD_PARAM System.ArgumentException or System.NullArgumentException
DDS_RETCODE_PRECONDITION_NOT_MET Omg.Dds.Core.PreconditionNotMetException
DDS_RETCODE_ILLEGAL_OPERATION System.InvalidOperationException
DDS_RETCODE_OUT_OF_RESOURCES Omg.Dds.Core.OutOfResourcesException
DDS_RETCODE_NOT_ENABLED Omg.Dds.Core.NotEnabledException
DDS_RETCODE_IMMUTABLE_POLICY Omg.Dds.Core.ImmutablePolicyException
DDS_RETCODE_INCONSISTENT_POLICY Omg.Dds.Core.InconsistentPolicyException
DDS_RETCODE_ALREADY_DELETED System.ObjectDisposedException
DDS_RETCODE_TIMEOUT System.TimeoutException
DDS_RETCODE_UNSUPPORTED System.NotSupportedException
DDS_RETCODE_NOT_ALLOWED_BY_SECURITY Omg.Dds.Core.NotAllowedBySecurityException

In most cases, the exception Message includes additional information about the error. This information may also be logged by Rti.Config.Logger.

Depending on the verbosity, Rti.Config.Logger will also log warnings and other informational messages that don't cause an exception.

Note
Errors that occur before the creation of the application's first DomainParticipant are also logged by Rti.Config.Logger, but the exception they produce may not include the details in its Message.

Methods and properties never return null to indicate an error. When a method can return null (for example, Rti.Dds.Domain.DomainParticipant.LookupDataReader()), it is explicitly documented and the method has the attribute [return: MaybeNull].

Methods and properties in general don't accept null arguments either. If an argument of property can be null (for example Rti.Dds.Core.QosProvider.DefaultProfile), it also documents it and has the [AllowNull] attribute.