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 cf64a41 commit 7ed5702Copy full SHA for 7ed5702
rclrs/src/error.rs
@@ -4,12 +4,19 @@ 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: /// ```rust
14
+ /// let error: RclrsError = RclrsError::RclError { code: RclReturnCode::Timeout, msg: None };
15
+ /// match &error {
16
+ /// RclrsError::RclError { msg, .. } => assert_eq!(msg, &None),
17
+ /// _ => panic!("Unexpected error variant"),
18
+ /// }
19
+ /// ```
20
RclError {
21
/// The error code.
22
code: RclReturnCode,
0 commit comments