update permanent status codes api

This commit is contained in:
yggverse 2025-03-25 04:43:56 +02:00
parent 0c75da793f
commit e96ff688b3
14 changed files with 644 additions and 158 deletions

View file

@ -2,7 +2,7 @@ use std::fmt::{Display, Formatter, Result};
#[derive(Debug)]
pub enum Error {
Code,
Code(u8),
Permanent(super::permanent::Error),
Protocol,
Temporary(super::temporary::Error),
@ -11,8 +11,8 @@ pub enum Error {
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> Result {
match self {
Self::Code => {
write!(f, "Code group error")
Self::Code(b) => {
write!(f, "Unexpected status code byte: {b}")
}
Self::Permanent(e) => {
write!(f, "Permanent failure group error: {e}")