1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::login::LoginCredentials;
use crate::message::IRCParseError;
use crate::transport::Transport;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error<T: Transport, L: LoginCredentials> {
#[error("Underlying transport failed to connect: {0}")]
ConnectError(T::ConnectError),
#[error("Error received from incoming stream of messages: {0}")]
IncomingError(T::IncomingError),
#[error("Error received while trying to send message(s) out: {0}")]
OutgoingError(T::OutgoingError),
#[error("Incoming message was not valid IRC: {0}")]
IRCParseError(IRCParseError),
#[error("Failed to get login credentials to log in with: {0}")]
LoginError(L::Error),
#[error("Received RECONNECT command by IRC server")]
ReconnectCmd,
#[error("Did not receive a PONG back after sending PING")]
PingTimeout,
#[error("Remote server unexpectedly closed connection")]
ConnectionClosed,
}