Skip to main content

rusty_modbus_sim/
error.rs

1//! Simulator error types.
2
3use rusty_modbus_server::{ServerError, StoreError};
4
5/// Errors that can occur during simulator operations.
6#[derive(Debug, thiserror::Error)]
7pub enum SimError {
8    /// YAML configuration parsing error.
9    #[error("config parse error: {0}")]
10    ConfigParse(#[from] serde_yaml_ng::Error),
11
12    /// Invalid configuration value.
13    #[error("config error: {0}")]
14    Config(String),
15
16    /// Underlying server error.
17    #[error("server error: {0}")]
18    Server(#[from] ServerError),
19
20    /// In-memory store setup error.
21    #[error("store error: {0}")]
22    Store(#[from] StoreError),
23}