mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
fix status code error types
This commit is contained in:
parent
8f7bbaec76
commit
c2b06fd688
4 changed files with 5 additions and 3 deletions
|
|
@ -16,14 +16,14 @@ impl Meta {
|
|||
Some(value) => Ok(Self {
|
||||
buffer: value.to_vec(),
|
||||
}),
|
||||
None => return Err(Error::Undefined),
|
||||
None => return Err(Error::Protocol),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_gstring(&self) -> Result<GString, Error> {
|
||||
match GString::from_utf8(self.buffer.clone()) {
|
||||
Ok(result) => Ok(result),
|
||||
Err(_) => Err(Error::Undefined),
|
||||
Err(_) => Err(Error::Decode),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
Decode,
|
||||
Protocol,
|
||||
Undefined,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ impl Status {
|
|||
Ok(string) => Self::from_string(string.as_str()),
|
||||
Err(_) => Err(Error::Decode),
|
||||
},
|
||||
None => Err(Error::Undefined),
|
||||
None => Err(Error::Protocol),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
Decode,
|
||||
Protocol,
|
||||
Undefined,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue