1use snafu::prelude::*;
2use tokio_tungstenite::tungstenite::Error as WsError;
3
4#[derive(Debug, Snafu)]
5#[snafu(visibility(pub(crate)))]
6pub enum Error {
7 #[snafu(display("aria2: responsed error: {source}"))]
8 Aria2 { source: crate::Aria2Error },
9 #[snafu(display("aria2: cannot parse value {value:?} as {to}"))]
10 Parse { value: String, to: String },
11 #[snafu(display("aria2: websocket error: {source}"))]
12 WebsocketIo { source: WsError },
13 #[snafu(display("aria2: json error: {source}"))]
14 Json { source: serde_json::Error },
15 #[snafu(display("aria2: websocket closed: {message}"))]
16 WebsocketClosed { message: String },
17 #[snafu(display("aria2: reconnect task timeout"))]
18 ReconnectTaskTimeout { source: tokio::time::error::Elapsed },
19}