mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-08 17:35:18 +00:00
normalize reading
This commit is contained in:
1 parent
a97da3fa1d
commit
189853cc23
10 files changed
+248
-56
No files matched your search
+11
-1
@@ -6,7 +6,7 @@ use std::{
|
||||
use rusqlite::Connection;
|
||||
use serde::Serialize;
|
||||
use thiserror::Error;
|
||||
use vibrato::errors::VibratoError;
|
||||
use vibrato::{Tokenizer, errors::VibratoError};
|
||||
use zip::result::ZipError;
|
||||
|
||||
#[derive(Debug, Error, Serialize)]
|
||||
@@ -39,6 +39,9 @@ pub enum CJDicError {
|
||||
#[error("ConnectionMutexGuardError: {0}")]
|
||||
ConnectionMutexGuardError(String),
|
||||
|
||||
#[error("TokenizerMutexGuardError: {0}")]
|
||||
TokenizerMutexGuardError(String),
|
||||
|
||||
#[error("Not found")]
|
||||
NotFound,
|
||||
|
||||
@@ -101,3 +104,10 @@ impl From<PoisonError<MutexGuard<'_, Connection>>> for CJDicError {
|
||||
CJDicError::ConnectionMutexGuardError(e.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PoisonError<MutexGuard<'_, Tokenizer>>> for CJDicError {
|
||||
fn from(e: PoisonError<MutexGuard<'_, Tokenizer>>) -> Self {
|
||||
eprintln!("{e:#}");
|
||||
CJDicError::TokenizerMutexGuardError(e.to_string())
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user