mavlink_bindgen/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum BindGenError {
5    /// Represents a failure to read the MAVLink definitions directory.
6    #[error("Could not read definitions directory {}: {source}", path.display())]
7    CouldNotReadDefinitionsDirectory {
8        source: std::io::Error,
9        path: std::path::PathBuf,
10    },
11    /// Represents a failure to read a MAVLink definition file.
12    #[error("Could not read definition file {}: {source}", path.display())]
13    CouldNotReadDefinitionFile {
14        source: std::io::Error,
15        path: std::path::PathBuf,
16    },
17    /// Represents a failure to read a directory entry in the MAVLink definitions directory.
18    #[error("Could not read MAVLink definitions directory entry {}: {source}", path.display())]
19    CouldNotReadDirectoryEntryInDefinitionsDirectory {
20        source: std::io::Error,
21        path: std::path::PathBuf,
22    },
23    /// Represents a failure to create a Rust file for the generated MAVLink bindings.
24    #[error("Could not create Rust bindings file {}: {source}", dest_path.display())]
25    CouldNotCreateRustBindingsFile {
26        source: std::io::Error,
27        dest_path: std::path::PathBuf,
28    },
29}