mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-08 17:35:18 +00:00
plan search db
This commit is contained in:
1 parent
ec14023c04
commit
a97da3fa1d
6 files changed
+61
-23
No files matched your search
+15
-1
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user