Class Exception

Inheritance Relationships

Derived Types

Class Documentation

class Exception

Exception: base class for specified DDS Exceptions.

DDS PIM Return Code

DDS-PSM-CXX Exception Class

std C++ Parent Exception

RETCODE_OK

Normal return; no exception

N/A

RETCODE_NO_DATA

Normal return with informational state attached

N/A

RETCODE_ERROR

Error

std::logic_error

RETCODE_BAD_PARAMETER

InvalidArgumentError

std::invalid_argument

RETCODE_TIMEOUT

TimeoutError

std::runtime_error

RETCODE_UNSUPPORTED

UnsupportedError

std::logic_error

RETCODE_ALREADY_DELETED

AlreadyClosedError

std::logic_error

RETCODE_ILLEGAL_OPERATION

IllegalOperationError

std::logic_error

RETCODE_NOT_ENABLED

NotEnabledError

std::logic_error

RETCODE_PRECONDITION_NOT_MET

PreconditionNotMetError

std::logic_error

RETCODE_IMMUTABLE_POLICY

ImmutablePolicyError

std::logic_error

RETCODE_INCONSISTENT_POLICY

InconsistentPolicyError

std::logic_error

RETCODE_OUT_OF_RESOURCES

OutOfResourcesError

std::runtime_error

The DDS-PSM-Cxx maps error codes to C++ exceptions defined in the dds::core namespace and inheriting from a base Exception class and the appropriate standard C++ exception. Table 7.3 lists the mapping between error codes as defined in the DDS PIM and C++ exceptions as used in this specification. Exceptions have value semantics; this means that they must always have deep copy semantics. The full list of exceptions is included in the file dds/core/Exceptions.hpp.

Subclassed by dds::core::AlreadyClosedError, dds::core::Error, dds::core::IllegalOperationError, dds::core::ImmutablePolicyError, dds::core::InconsistentPolicyError, dds::core::InvalidArgumentError, dds::core::InvalidDataError, dds::core::InvalidDowncastError, dds::core::NotEnabledError, dds::core::NullReferenceError, dds::core::OutOfResourcesError, dds::core::PreconditionNotMetError, dds::core::TimeoutError, dds::core::UnsupportedError

Public Functions

virtual OMG_DDS_API const char * what () const =0

Retrieve information about the exception that was thrown.

Example

try {
    // Do something that will trigger a dds exception, like:
    dds::domain::DomainParticipant participant = dds::core::null;
    participant.domain_id();
} catch (const dds::core::Exception& e) {
    std::cout << e.what() << std::endl;
}
Exception information (of the NullReferenceError in this case)
Null reference: Reference[157] == dds::core::null
========================================================================================
Context     : dds::domain::DomainParticipant::domain_id
Date        : Wed Oct 21 19:28:00 CET 2015
Node        : DeLorean
Process     : flux_capacitor <15423>
Thread      : mr_fusion b6f25700
Internals   : ReferenceImpl.hpp/157/V6.6.0
----------------------------------------------------------------------------------------
Report      : Null reference: Reference[157] == dds::core::null
Internals   : dds::core::Reference<DELEGATE>::delegate/ReferenceImpl.hpp/157

Returns

Exception information

Protected Functions

inline OMG_DDS_API Exception()