pulsectl/controllers/
error.rs1use crate::error::Error;
2
3#[derive(Debug, Clone)]
5pub enum ControllerError {
6 PulseCtl(String),
8 GetInfo(String),
10}
11
12impl std::fmt::Display for ControllerError {
13 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
14 match self {
15 Self::PulseCtl(e) => f.write_str(&format!("PulseCtl error: {}", e)),
16 Self::GetInfo(e) => f.write_str(&format!("GetInfo error: {}", e)),
17 }
18 }
19}
20
21impl std::error::Error for ControllerError {}
22
23impl From<Error> for ControllerError {
24 fn from(error: Error) -> Self {
25 Self::PulseCtl(error.to_string())
26 }
27}