pub enum WifiError {
CommandExecution(Error),
NmcliError {
message: String,
},
InterfaceNotFound(String),
ConnectionFailed {
ssid: String,
reason: String,
},
HotspotCreationFailed(String),
NoInternetConnectivity,
InvalidConfiguration(String),
NotSupported(String),
WifiDisabled,
ConnectionExists(String),
Timeout(String),
ParseError(String),
}Expand description
Errors that can occur when managing WiFi connections.
This enum covers all error conditions that may arise during WiFi operations, from command execution failures to connectivity issues.
§Error Categories
- System errors:
CommandExecution,NmcliError - Configuration errors:
InterfaceNotFound,InvalidConfiguration - Connection errors:
ConnectionFailed,HotspotCreationFailed - State errors:
WifiDisabled,NoInternetConnectivity
Variants§
CommandExecution(Error)
NetworkManager command failed to execute.
This typically indicates that nmcli is not installed or not in PATH.
NmcliError
nmcli command returned an error.
Contains the error message from NetworkManager.
InterfaceNotFound(String)
The specified wireless interface was not found.
Verify the interface name with nmcli device status.
ConnectionFailed
Failed to connect to the specified network.
Common causes include incorrect password, network out of range, or authentication failures.
HotspotCreationFailed(String)
Failed to create hotspot.
This can occur if the hardware doesn’t support AP mode, or if another connection is interfering.
NoInternetConnectivity
No internet connectivity detected.
The device is connected to a network but cannot reach the internet.
InvalidConfiguration(String)
Invalid configuration provided.
For example, a hotspot password shorter than 8 characters.
NotSupported(String)
The requested operation is not supported.
Some operations may not be available on certain hardware.
WifiDisabled
WiFi is disabled on the system.
Enable WiFi with WifiManager::enable_wifi
or via nmcli radio wifi on.
ConnectionExists(String)
A connection profile with this name already exists.
Timeout(String)
Timeout waiting for operation to complete.
Consider increasing the timeout or checking network conditions.
ParseError(String)
Failed to parse nmcli output.
This may indicate an incompatible NetworkManager version.