implement to_string method, prevent memory index overwrite on validation step

This commit is contained in:
yggverse 2024-11-23 18:04:57 +02:00
parent cda94cba2e
commit c86dca53bd
10 changed files with 100 additions and 21 deletions

View file

@ -3,3 +3,16 @@ pub enum Error {
Database(sqlite::Error),
Gemini(super::gemini::Error),
}
impl Error {
pub fn to_string(&self) -> String {
match self {
Self::Database(reason) => {
format!("Database error: {}", reason.to_string())
}
Self::Gemini(reason) => {
format!("Could not init Gemini identity: {}", reason.to_string())
}
}
}
}