17.2. Exceptions¶
Fast DDS provides a RpcException base class for all the exceptions that can be thrown by the RPC API.
It also provides some builtin exceptions, described in the following table:
Exception |
Description |
|---|---|
|
Exception thrown by the RPC API when the communication with the remote endpoint breaks. |
|
Exception thrown by the RPC API when the feed is cancelled. |
|
Exception thrown by the RPC API when an operation times out. |
According to the RPC over DDS specification 7.5.2,
server-side error conditions are communicated back to the client
using error codes, represented by the RemoteExceptionCode_t enumeration. Fast DDS provides a
RpcRemoteException subclass that serves as a base class for a set of exceptions that can be thrown by the RPC API
when a server-side error condition occurs.
The following table describes the equivalence between error codes and exceptions:
Error code |
Description |
Exception |
|---|---|---|
|
Operation is valid but it is unsupported (a.k.a. not implemented). |
|
|
The value of a parameter passed has an illegal value. |
|
|
The remote service ran out of resources while processing the request. |
|
|
The operation called is unknown. |
|
|
A generic, unspecified exception was raised by the service implementation. |
|
Finally, user can also define custom exceptions in the IDL interface file
(see Exceptions), that can be raised by calling an operation method.
Fast DDS provides a RpcOperationError subclass that serves as a base class for all these kind of exceptions,
which are generated by Fast DDS-Gen tool from the IDL file.