wifi_ctrl/
error.rs

1use super::*;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5pub enum Error {
6    #[error("io error: {0}")]
7    Io(#[from] std::io::Error),
8    #[error("start-up aborted")]
9    StartupAborted,
10    #[error("error parsing wifi status {e}: \n{s}")]
11    ParsingWifiStatus { e: config::ConfigError, s: String },
12    #[error("error parsing wifi config {e}: \n{s}")]
13    ParsingWifiConfig { e: config::ConfigError, s: String },
14    #[error("unexpected wifi ap response: {0}")]
15    UnexpectedWifiApRepsonse(String),
16    #[error("timeout waiting for response")]
17    Timeout,
18    #[error("did not write all bytes {0}/{1}")]
19    DidNotWriteAllBytes(usize, usize),
20    #[error("error parsing int: {0}")]
21    ParseInt(#[from] std::num::ParseIntError),
22    #[error("utf8 error: {0}")]
23    Utf8Parse(#[from] std::str::Utf8Error),
24    #[error("recv error: {0}")]
25    Recv(#[from] oneshot::error::RecvError),
26    #[error("unsolicited socket io error: {0}")]
27    UnsolicitedIoError(std::io::Error),
28    #[error("wifi_ctrl::station internal request channel unexpectedly closed")]
29    WifiStationRequestChannelClosed,
30    #[error("wifi_ctrl::station internal event channel unexpectedly closed")]
31    WifiStationEventChannelClosed,
32    #[error("wifi_ctrl::ap internal request channel unexpectedly closed")]
33    WifiApRequestChannelClosed,
34    #[error("wifi_ctrl::ap internal event channel unexpectedly closed")]
35    WifiApEventChannelClosed,
36    #[error("wifi ap broadcast: {0}")]
37    WifiApBroadcast(#[from] broadcast::error::SendError<ap::Broadcast>),
38    #[error("wifi::sta broadcast: {0}")]
39    WifiStaBroadcast(#[from] broadcast::error::SendError<sta::Broadcast>),
40    #[error("timeout opening socket {0}")]
41    TimeoutOpeningSocket(String),
42    #[error("permission denied opening socket {0}")]
43    PermissionDeniedOpeningSocket(String),
44}