#[non_exhaustive]pub enum DdsError {
Show 15 variants
BadParameter {
what: &'static str,
},
PreconditionNotMet {
reason: &'static str,
},
WireError {
message: String,
},
InconsistentPolicy {
what: &'static str,
},
TransportError {
label: &'static str,
},
OutOfResources {
what: &'static str,
},
Timeout,
Unsupported {
feature: &'static str,
},
NotAllowedBySecurity {
what: &'static str,
},
IllegalOperation {
what: &'static str,
},
ImmutablePolicy {
policy: &'static str,
},
AlreadyDeleted,
NoData,
Other {
reason: &'static str,
},
NotEnabled,
}Expand description
Errors from DCPS operations. Roughly analogous to the spec
ReturnCode_t enum; we omit RETCODE_OK (using Result::Ok
instead) and merge BAD_PARAMETER + PRECONDITION_NOT_MET where
the distinction doesn’t help.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadParameter
Invalid parameter (e.g. an empty topic name).
PreconditionNotMet
Operation does not fit the entity state (e.g. write on a
DataWriter whose participant has been shut down).
WireError
Underlying wire/CDR operation failed.
InconsistentPolicy
QoS policy set is not consistent. Example: Reliability= Best-Effort + History=KeepAll without resource_limits — Spec §2.2.3 lists some incompatible combinations.
TransportError
Transport operation failed.
OutOfResources
Resource limit reached (max_samples, max_instances, etc.).
Timeout
Timeout on a blocking operation (take_w_timeout, etc.).
Unsupported
Operation not implemented in v1.2.
NotAllowedBySecurity
Operation forbidden by the security policy — DDS-Security 1.2 §7.3.25, DCPS 1.4 §2.2.2.1.1 ReturnCode_t = NOT_ALLOWED_BY_SECURITY. The permissions/access plugin denied the read/write on a protected topic; the caller must not learn which permissions detail was the cause (information leak).
IllegalOperation
IllegalOperation — the operation does not fit structurally
(e.g. write() on a DataReader). DCPS 1.4 §2.2.2.1.1
ReturnCode_t = ILLEGAL_OPERATION.
ImmutablePolicy
ImmutablePolicy — set_qos on a post-enable immutable QoS
policy. DCPS 1.4 §2.2.2.1.1 ReturnCode_t = IMMUTABLE_POLICY.
AlreadyDeleted
AlreadyDeleted — operation on a deleted entity.
DCPS 1.4 §2.2.2.1.1 ReturnCode_t = ALREADY_DELETED.
NoData
NoData — read/take with no new samples. DCPS 1.4 §2.2.2.1.1
ReturnCode_t = NO_DATA. In practice often returned as an empty
sample Vec rather than as an error.
Other
Error — generic, non-specific error. DCPS 1.4 §2.2.2.1.1
ReturnCode_t = ERROR. Last resort when no more specific variant
fits; avoids an information leak toward the caller.
NotEnabled
NotEnabled — operation on an entity that has not yet been
activated via enable(). DCPS 1.4 §2.2.2.1.1 ReturnCode_t =
NOT_ENABLED. §2.1.2 — entities are disabled after create_*
until enable(); many ops must then return NotEnabled.
Implementations§
Trait Implementations§
impl Eq for DdsError
Source§impl Error for DdsError
Available on crate feature std only.
impl Error for DdsError
std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()