feat: add an Error type to Packet::parse

instead of error logging manually inside `parse`,
return a Result with a custom enum
This commit is contained in:
Tamipes 2025-12-03 22:58:21 +01:00
parent 92dfbd490c
commit 4cf3d5aea0
5 changed files with 69 additions and 60 deletions

View file

@ -81,3 +81,12 @@ impl From<&str> for OpaqueError {
}
}
}
impl From<crate::packets::ParseError> for OpaqueError {
fn from(value: crate::packets::ParseError) -> Self {
Self {
span_trace: SpanTrace::capture(),
context: format!("{:?}", value),
}
}
}