plan search db

This commit is contained in:
polv committed 2026-03-08 19:17:31 +07:00
1 parent ec14023c04
commit a97da3fa1d
6 files changed
+61 -23

No files matched your search

+15 -1
View File
@@ -1,5 +1,9 @@
use std::string::FromUtf8Error;
use std::{
string::FromUtf8Error,
sync::{MutexGuard, PoisonError},
};
use rusqlite::Connection;
use serde::Serialize;
use thiserror::Error;
use vibrato::errors::VibratoError;
@@ -32,6 +36,9 @@ pub enum CJDicError {
#[error("FromUtf8Error: {0}")]
FromUtf8Error(String),
#[error("ConnectionMutexGuardError: {0}")]
ConnectionMutexGuardError(String),
#[error("Not found")]
NotFound,
@@ -87,3 +94,10 @@ impl From<FromUtf8Error> for CJDicError {
CJDicError::FromUtf8Error(e.to_string())
}
}
impl From<PoisonError<MutexGuard<'_, Connection>>> for CJDicError {
fn from(e: PoisonError<MutexGuard<'_, Connection>>) -> Self {
eprintln!("{e:#}");
CJDicError::ConnectionMutexGuardError(e.to_string())
}
}