mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
handle error details
This commit is contained in:
parent
b7900489b0
commit
fa9c2b4fbc
@ -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
|
||||
}
|
||||
|
@ -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<dyn std::error::Error>),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user