mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http protocol: implement Error for RequestParseError
This commit is contained in:
parent
1c4655e0d7
commit
d621fb1f85
1 changed files with 11 additions and 0 deletions
|
|
@ -250,6 +250,17 @@ pub enum RequestParseError {
|
|||
Invalid(anyhow::Error),
|
||||
}
|
||||
|
||||
impl ::std::fmt::Display for RequestParseError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::NeedMoreData => write!(f, "Incomplete request, more data needed"),
|
||||
Self::Invalid(err) => write!(f, "Invalid request: {:#}", err),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::error::Error for RequestParseError {}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Request {
|
||||
Announce(AnnounceRequest),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue