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 38a6a92 commit b75803aCopy full SHA for b75803a
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
+ /// let error: RclrsError = RclrsError::RclError { code: RclReturnCode::Timeout, msg: None };
16
+ /// match &error {
17
+ /// RclrsError::RclError { msg, .. } => assert_eq!(msg, &None),
18
+ /// _ => panic!("Unexpected error variant"),
19
+ /// }
20
+ /// ```
21
RclError {
22
/// The error code.
23
code: RclReturnCode,
0 commit comments