mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
implement to_string method, prevent memory index overwrite on validation step
This commit is contained in:
parent
58ed923bc7
commit
cda94cba2e
4 changed files with 42 additions and 15 deletions
|
|
@ -1,5 +1,18 @@
|
|||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
Clear,
|
||||
Overwrite(i64),
|
||||
Overwrite(String),
|
||||
Unexpected,
|
||||
}
|
||||
|
||||
impl Error {
|
||||
pub fn to_string(&self) -> String {
|
||||
match self {
|
||||
Self::Clear => format!("Could not cleanup memory index"),
|
||||
Self::Overwrite(key) => {
|
||||
format!("Overwrite attempt for existing record `{key}`")
|
||||
}
|
||||
Self::Unexpected => format!("Unexpected error"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue