Skip to main content

axonml_profile/
error.rs

1//! Error types for the profiling module.
2
3use thiserror::Error;
4
5/// Result type for profiling operations.
6pub type ProfileResult<T> = Result<T, ProfileError>;
7
8/// Error types for profiling operations.
9#[derive(Error, Debug)]
10pub enum ProfileError {
11    /// Operation not found in profiler
12    #[error("Operation not found: {0}")]
13    OperationNotFound(String),
14
15    /// Invalid profiler state
16    #[error("Invalid profiler state: {0}")]
17    InvalidState(String),
18
19    /// IO error during report export
20    #[error("IO error: {0}")]
21    IoError(#[from] std::io::Error),
22
23    /// Serialization error
24    #[error("Serialization error: {0}")]
25    SerializationError(String),
26
27    /// Timer error
28    #[error("Timer error: {0}")]
29    TimerError(String),
30}