treewide: improve logging; custom error types with thiserror

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I6a6a696464e4123d15cfaedf4727776e55948369
This commit is contained in:
raf 2025-08-12 16:08:28 +03:00
commit 6e21021306
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
10 changed files with 221 additions and 166 deletions

View file

@ -1,12 +1,15 @@
use crate::db::{ClipboardDb, SledClipboardDb};
use crate::db::StashError;
pub trait WipeCommand {
fn wipe(&self);
fn wipe(&self) -> Result<(), StashError>;
}
impl WipeCommand for SledClipboardDb {
fn wipe(&self) {
self.wipe_db();
fn wipe(&self) -> Result<(), StashError> {
self.wipe_db()?;
log::info!("Database wiped");
Ok(())
}
}