Skip to main content

oxurack_rt/
error.rs

1//! Error types for the oxurack-rt crate.
2
3/// Errors that can occur during real-time MIDI operations.
4#[non_exhaustive]
5#[derive(Debug, thiserror::Error)]
6pub enum Error {
7    /// Failed to elevate the RT thread to real-time priority.
8    #[error("RT priority elevation failed: {0}")]
9    PriorityElevation(String),
10
11    /// MIDI subsystem initialization failed.
12    #[error("MIDI initialization failed: {0}")]
13    MidiInit(String),
14
15    /// A requested MIDI port could not be found by name.
16    #[error("MIDI port not found: {name}")]
17    PortNotFound {
18        /// The name that was searched for.
19        name: String,
20    },
21
22    /// The RT-to-ECS lock-free queue is full; events are being dropped.
23    #[error("RT-to-ECS queue full")]
24    QueueFull,
25
26    /// The RT thread panicked and is no longer running.
27    #[error("RT thread panicked")]
28    ThreadPanicked,
29
30    /// Attempted to stop or interact with a runtime that has already stopped.
31    #[error("runtime already stopped")]
32    AlreadyStopped,
33}