We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b40f96a commit 31a5fd2Copy full SHA for 31a5fd2
rclrs/src/error.rs
@@ -4,12 +4,20 @@ use std::{
4
fmt::{self, Display},
5
};
6
7
-use crate::{rcl_bindings::*, DeclarationError};
+use crate::{DeclarationError, rcl_bindings::*};
8
9
/// The main error type.
10
#[derive(Debug, PartialEq, Eq)]
11
pub enum RclrsError {
12
/// An error originating in the `rcl` layer.
13
+ /// Example:
14
+ /// ```rust
15
+ /// use rclrs::{RclReturnCode,RclrsError};
16
+ /// let error: RclrsError = RclrsError::RclError { code: RclReturnCode::Timeout, msg: None };
17
+ /// if let RclrsError::RclError { msg, .. } = &error {
18
+ /// assert_eq!(msg, &None);
19
+ /// }
20
+ /// ```
21
RclError {
22
/// The error code.
23
code: RclReturnCode,
0 commit comments