#[non_exhaustive]pub enum Error {
Connection(String),
Timeout(String),
Box {
status: u16,
message: String,
},
UnsupportedByBox {
message: String,
},
Decode(String),
NotSupportedByBox {
feature: &'static str,
details: &'static str,
},
AuthRequired {
box_host: String,
auth_url: String,
message: String,
},
Config(String),
Stream(String),
}Expand description
All the ways a Lager box interaction can fail.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connection(String)
The box could not be reached at all (DNS, TCP connect, transport failure). Check network/Tailscale and that the box is online.
Timeout(String)
The HTTP request timed out client-side. For long-running actions
(energy integration windows, wait_for_level) the crate widens the
timeout automatically, so hitting this usually means the box stalled.
Box
The box accepted the request but reported failure. Carries the HTTP
status and the box’s error message. Note the box can report failure
with HTTP 200 (e.g. a cross-role instrument conflict); this variant
covers that too.
Fields
UnsupportedByBox
HTTP 501: this box image does not serve the endpoint. The box needs a software update.
Decode(String)
The box’s response could not be parsed into the expected shape.
NotSupportedByBox
The net type exists in the Lager Python API but its box endpoint is
not yet available on the :9000 HTTP API, so this crate ships it as a
documented stub. See MISSING_ENDPOINTS.md in the crate repository.
Fields
AuthRequired
The box sits behind an authenticating gateway and the request was
denied (HTTP 401 with the X-Gateway-Auth-Url discovery header),
with no usable credential available. Sign in with the Lager CLI
(lager login <auth_url>) — this crate reuses the CLI’s session —
or supply a token via LagerBoxBuilder::bearer_token /
LAGER_GATEWAY_TOKEN.
Fields
Config(String)
Client-side configuration problem (bad host string, missing env var).
Stream(String)
A streaming session (UART) reported an error, e.g. the net is in use by another session or the device disappeared.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()