diff --git a/src/profile/identity/gemini.rs b/src/profile/identity/gemini.rs index 18b152f2..87a5653b 100644 --- a/src/profile/identity/gemini.rs +++ b/src/profile/identity/gemini.rs @@ -80,7 +80,7 @@ impl Gemini { self.index()?; Ok(profile_identity_gemini_id) } - Err(_) => Err(Error::DatabaseRecordCreate), + Err(reason) => Err(Error::DatabaseRecordCreate(reason)), }, Err(reason) => Err(Error::Certificate(reason)), } @@ -96,11 +96,11 @@ impl Gemini { Ok(records) => { for record in records { if self.memory.add(record.id, record.pem).is_err() { - return Err(Error::MemoryIndex); // @TODO + return Err(Error::MemoryIndex(record.id)); } } } - Err(_) => return Err(Error::DatabaseIndex), // @TODO + Err(reason) => return Err(Error::DatabaseIndex(reason)), }; Ok(()) // @TODO } diff --git a/src/profile/identity/gemini/error.rs b/src/profile/identity/gemini/error.rs index 1bd9114b..bf9285cc 100644 --- a/src/profile/identity/gemini/error.rs +++ b/src/profile/identity/gemini/error.rs @@ -1,8 +1,8 @@ #[derive(Debug)] pub enum Error { AuthInit(super::auth::Error), - DatabaseIndex, - DatabaseRecordCreate, - MemoryIndex, + DatabaseIndex(sqlite::Error), + DatabaseRecordCreate(sqlite::Error), + MemoryIndex(i64), Certificate(Box), }