1#[derive(Debug)]
2pub enum MonitorError {
3 AlreadyRunning,
4 NotRunning,
5 PlatformError(String),
6 ForeignException(String),
7}
8
9impl std::fmt::Display for MonitorError {
10 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11 match self {
12 MonitorError::AlreadyRunning => write!(f, "Monitor is already running"),
13 MonitorError::NotRunning => write!(f, "Monitor is not running"),
14 MonitorError::PlatformError(msg) => write!(f, "Platform error: {}", msg),
15 MonitorError::ForeignException(msg) => write!(f, "Foreign exception: {}", msg),
16 }
17 }
18}
19
20impl std::error::Error for MonitorError {}