1use thiserror::Error;
4use mabi_core::Error as CoreError;
5
6pub type BacnetResult<T> = Result<T, BacnetError>;
8
9#[derive(Debug, Error)]
11pub enum BacnetError {
12 #[error("Object not found: {object_type}:{instance}")]
14 ObjectNotFound { object_type: String, instance: u32 },
15
16 #[error("Property not found: {property}")]
18 PropertyNotFound { property: String },
19
20 #[error("Invalid object type: {0}")]
22 InvalidObjectType(u16),
23
24 #[error("Server error: {0}")]
26 Server(String),
27
28 #[error("Protocol error: {0}")]
30 Protocol(String),
31
32 #[error("I/O error: {0}")]
34 Io(#[from] std::io::Error),
35
36 #[error("Core error: {0}")]
38 Core(#[from] CoreError),
39}