wled_json_api_library/
errors.rs1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum WledJsonApiError {
5 #[error("serde error: {0}")]
6 SerdeError(#[from] serde_json::Error),
7 #[error("reqwest error: {0}")]
8 ReqwestError(#[from] reqwest::Error),
9 #[error("Error adding port to url, honestly no idea how this happens, should not be possible")]
10 UnableToAddPortToURL,
11 #[error("Server responded with HTTP code {0}")]
12 HttpError(reqwest::StatusCode),
13 #[error("Attempted to flush with nothing in internal buffer. either set it through the public data member, or get from the server and (presumably) change something")]
14 FlushNone,
15 #[error("Attempted to read a key that doesn't exist \
16 (either you need to read it from the server, or the server didn't send one)")]
17 MissingKey,
18}