pub enum WepubError {
Network(Error),
Api {
status: u16,
body: String,
},
Auth(String),
Validation {
uuid: String,
body: String,
},
Upload {
item_id: String,
body: String,
},
Publish {
item_id: String,
body: String,
},
Json(Error),
Io(Error),
InvalidUrl(String),
Internal(String),
}Expand description
Error type returned by every fallible call in this crate.
Variants split errors by responsibility: the network layer, the wire
protocol, the credentials, the per-store domain (validation / upload /
publish), and a catch-all Internal for
“should-never-happen” states.
Variants§
Network(Error)
Underlying transport failure surfaced by reqwest (DNS, TCP, TLS,
connect / read / overall timeout, body read error, etc.).
Api
The remote returned a non-2xx HTTP status. body carries the
(possibly empty) response body verbatim.
Fields
Auth(String)
The OAuth / JWT credential exchange failed at the protocol level
(e.g. Google’s token endpoint returned invalid_grant).
Validation
Firefox AMO reported the upload as valid: false, or validation
polling exceeded its timeout. body is the validation result JSON
(pretty-printed) or a timeout description.
Fields
Upload
Chrome Web Store reported uploadState = FAILED or NOT_FOUND, or
upload polling exceeded its timeout.
Fields
Publish
The CWS publish endpoint returned 200 OK but the item state is a
terminal failure (REJECTED or CANCELLED). The HTTP call itself
succeeded, hence this is not Api.
Fields
Json(Error)
JSON deserialization of a response body failed. Indicates the wire shape diverged from this crate’s expectations.
Io(Error)
Local filesystem I/O failed (e.g. could not read the source zip).
InvalidUrl(String)
A URL passed in by the caller (typically through one of the with_*
builders) failed to parse.
Internal(String)
“Should never happen” programmer-error states: URL join failure,
pre-epoch system clock, JWT encode failure, hard-coded MIME literal
rejected by mime_str. Reaching this variant indicates a bug in
wepub-core itself.
Trait Implementations§
Source§impl Debug for WepubError
impl Debug for WepubError
Source§impl Display for WepubError
impl Display for WepubError
Source§impl Error for WepubError
impl Error for WepubError
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()