delegate child errors to parent handler

This commit is contained in:
yggverse 2024-11-20 09:27:40 +02:00
parent e1592425b9
commit f9e35553da
7 changed files with 11 additions and 12 deletions

View file

@ -5,7 +5,7 @@ mod error;
mod memory;
use database::Database;
use error::Error;
pub use error::Error;
use memory::Memory;
use sqlite::{Connection, Transaction};
@ -85,12 +85,11 @@ impl Auth {
match self.database.records(None) {
Ok(records) => {
for record in records {
if self
if let Err(reason) = self
.memory
.add(record.url, record.profile_identity_gemini_id)
.is_err()
{
return Err(Error::MemoryIndex);
return Err(Error::Memory(reason));
}
}
}