mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
handle error details
This commit is contained in:
parent
b7900489b0
commit
fa9c2b4fbc
2 changed files with 6 additions and 6 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue