From a48f62eb1392760ea5cef9920a5a9741ce0eaee0 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 23 Nov 2024 14:55:29 +0200 Subject: [PATCH] delegate memory error details --- src/profile/identity/gemini.rs | 4 ++-- src/profile/identity/gemini/error.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/profile/identity/gemini.rs b/src/profile/identity/gemini.rs index fec3d136..a08f8802 100644 --- a/src/profile/identity/gemini.rs +++ b/src/profile/identity/gemini.rs @@ -96,8 +96,8 @@ impl Gemini { match self.database.records() { Ok(records) => { for record in records { - if self.memory.add(record.id, record.pem).is_err() { - return Err(Error::MemoryIndex(record.id)); + if let Err(reason) = self.memory.add(record.id, record.pem) { + return Err(Error::MemoryIndex(reason)); } } } diff --git a/src/profile/identity/gemini/error.rs b/src/profile/identity/gemini/error.rs index 2030e33f..255114a6 100644 --- a/src/profile/identity/gemini/error.rs +++ b/src/profile/identity/gemini/error.rs @@ -4,6 +4,6 @@ pub enum Error { DatabaseIndex(sqlite::Error), DatabaseRecordCreate(sqlite::Error), MemoryClear(super::memory::Error), - MemoryIndex(i64), + MemoryIndex(super::memory::Error), Certificate(Box), }