delegate memory error details

This commit is contained in:
yggverse 2024-11-23 14:55:29 +02:00
parent d866f0f3f5
commit a48f62eb13
2 changed files with 3 additions and 3 deletions

View File

@ -96,8 +96,8 @@ impl Gemini {
match self.database.records() { match self.database.records() {
Ok(records) => { Ok(records) => {
for record in records { for record in records {
if self.memory.add(record.id, record.pem).is_err() { if let Err(reason) = self.memory.add(record.id, record.pem) {
return Err(Error::MemoryIndex(record.id)); return Err(Error::MemoryIndex(reason));
} }
} }
} }

View File

@ -4,6 +4,6 @@ pub enum Error {
DatabaseIndex(sqlite::Error), DatabaseIndex(sqlite::Error),
DatabaseRecordCreate(sqlite::Error), DatabaseRecordCreate(sqlite::Error),
MemoryClear(super::memory::Error), MemoryClear(super::memory::Error),
MemoryIndex(i64), MemoryIndex(super::memory::Error),
Certificate(Box<dyn std::error::Error>), Certificate(Box<dyn std::error::Error>),
} }