mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
handle memory clear errors
This commit is contained in:
parent
efa3bc48c3
commit
8a4e979d48
8 changed files with 33 additions and 11 deletions
|
|
@ -84,7 +84,9 @@ impl Auth {
|
|||
/// Create new `Memory` index from `Database` for `Self`
|
||||
pub fn index(&self) -> Result<(), Error> {
|
||||
// Clear previous records
|
||||
self.memory.clear();
|
||||
if let Err(reason) = self.memory.clear() {
|
||||
return Err(Error::MemoryClear(reason));
|
||||
}
|
||||
|
||||
// Build new index
|
||||
match self.database.records(None) {
|
||||
|
|
@ -100,6 +102,7 @@ impl Auth {
|
|||
}
|
||||
Err(reason) => return Err(Error::DatabaseIndex(reason)),
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue