Revision control
Copy as Markdown
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Network error: {0}")]
Network(#[from] viaduct::Error),
#[error("UTF-8 error: {0}")]
Utf8(#[from] std::string::FromUtf8Error),
#[error("URL parse error: {0}")]
UrlParse(#[from] url::ParseError),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Status error: {0}")]
Status(#[from] viaduct::UnexpectedStatus),
#[error("Relay API returned an error: {0}")]
RelayApi(String),
}