connection working

This commit is contained in:
nora 2022-02-19 18:12:28 +01:00
parent ca1f372665
commit 13deef42fd
9 changed files with 217 additions and 82 deletions

View file

@ -1,6 +1,8 @@
use std::io::Error;
pub type Result<T> = std::result::Result<T, TransError>;
pub type StdResult<T, E> = std::result::Result<T, E>;
pub type Result<T> = StdResult<T, TransError>;
#[derive(Debug, thiserror::Error)]
pub enum TransError {
@ -34,7 +36,7 @@ pub enum ConException {
FrameError,
#[error("503 Command invalid")]
CommandInvalid,
#[error("503 Syntax error")]
#[error("503 Syntax error | {0:?}")]
/// A method was received but there was a syntax error. The string stores where it occured.
SyntaxError(Vec<String>),
#[error("504 Channel error")]
@ -43,5 +45,11 @@ pub enum ConException {
Todo,
}
impl ConException {
pub fn into_trans(self) -> TransError {
TransError::Invalid(ProtocolError::ConException(self))
}
}
#[derive(Debug, thiserror::Error)]
pub enum ChannelException {}