mirror of
https://github.com/house-of-vanity/mystem-rs.git
synced 2025-07-07 13:34:07 +00:00
Init
This commit is contained in:
20
src/error.rs
Normal file
20
src/error.rs
Normal file
@ -0,0 +1,20 @@
|
||||
use std::fmt;
|
||||
use subprocess::PopenError;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum AppError {
|
||||
PartOfSpeechError(&'static str),
|
||||
GrammemError(&'static str),
|
||||
PopenError(PopenError),
|
||||
MystemError(&'static str),
|
||||
}
|
||||
impl fmt::Display for AppError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "An error occurred.")
|
||||
}
|
||||
}
|
||||
impl From<PopenError> for AppError {
|
||||
fn from(e: PopenError) -> AppError {
|
||||
return AppError::PopenError(e);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user