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:
parent
92dfbd490c
commit
4cf3d5aea0
5 changed files with 69 additions and 60 deletions
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue