2017-06-20 14:54:06 -04:00
|
|
|
//! Errors for `irc` crate using `error_chain`.
|
|
|
|
#![allow(missing_docs)]
|
|
|
|
|
|
|
|
error_chain! {
|
|
|
|
foreign_links {
|
|
|
|
Io(::std::io::Error);
|
|
|
|
Tls(::native_tls::Error);
|
2017-06-21 13:18:22 -04:00
|
|
|
Recv(::std::sync::mpsc::RecvError);
|
|
|
|
SendMessage(::futures::sync::mpsc::SendError<::proto::Message>);
|
|
|
|
OneShotCancelled(::futures::sync::oneshot::Canceled);
|
2017-06-27 18:21:11 -07:00
|
|
|
Timer(::tokio_timer::TimerError);
|
2017-06-20 14:54:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
errors {
|
|
|
|
/// A parsing error for empty strings as messages.
|
|
|
|
ParseEmpty {
|
|
|
|
description("Cannot parse an empty string as a message.")
|
|
|
|
display("Cannot parse an empty string as a message.")
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A parsing error for invalid or missing commands in messages.
|
|
|
|
InvalidCommand {
|
|
|
|
description("Message contained a missing or invalid Command.")
|
|
|
|
display("Message contained a missing or invalid Command.")
|
|
|
|
}
|
|
|
|
|
|
|
|
/// A parsing error for failures in subcommand parsing (e.g. CAP and metadata).
|
|
|
|
SubCommandParsingFailed {
|
|
|
|
description("Failed to parse an IRC subcommand.")
|
|
|
|
display("Failed to parse an IRC subcommand.")
|
|
|
|
}
|
2017-06-21 13:18:22 -04:00
|
|
|
|
2017-06-22 17:33:29 -04:00
|
|
|
/// Failed to parse a mode correctly.
|
2017-06-22 13:59:18 -04:00
|
|
|
ModeParsingFailed {
|
|
|
|
description("Failed to parse a mode correctly.")
|
|
|
|
display("Failed to parse a mode correctly.")
|
|
|
|
}
|
|
|
|
|
2017-06-21 13:18:22 -04:00
|
|
|
/// An error occurred on one of the internal channels of the `IrcServer`.
|
|
|
|
ChannelError {
|
|
|
|
description("An error occured on one of the IrcServer's internal channels.")
|
|
|
|
display("An error occured on one of the IrcServer's internal channels.")
|
|
|
|
}
|
2017-06-21 21:50:38 -04:00
|
|
|
|
|
|
|
/// An error occured causing a mutex for a logged transport to be poisoned.
|
|
|
|
PoisonedLog {
|
|
|
|
description("An error occured causing a mutex for a logged transport to be poisoned.")
|
|
|
|
display("An error occured causing a mutex for a logged transport to be poisoned.")
|
|
|
|
}
|
2017-06-22 17:33:29 -04:00
|
|
|
|
|
|
|
/// Connection timed out due to no ping response.
|
|
|
|
PingTimeout {
|
|
|
|
description("The connection timed out due to no ping response.")
|
|
|
|
display("The connection timed out due to no ping response.")
|
|
|
|
}
|
2018-01-27 20:26:56 +01:00
|
|
|
|
|
|
|
NicknameNotSpecified {
|
|
|
|
description("No nickname was specified for use with this IrcServer.")
|
|
|
|
display("No nickname was specified for use with this IrcServer.")
|
|
|
|
}
|
|
|
|
|
|
|
|
ServerNotSpecified {
|
|
|
|
description("No server was specified to connect to.")
|
|
|
|
display("No server was specified to connect to.")
|
|
|
|
}
|
2017-06-20 14:54:06 -04:00
|
|
|
}
|
|
|
|
}
|