mirror of
https://github.com/house-of-vanity/desubot.git
synced 2025-07-08 13:04:06 +00:00
Mystem wrapper reworked.
This commit is contained in:
@ -2,10 +2,11 @@ use reqwest::Error as reqwest_error;
|
||||
use rusqlite::Error as sqlite_error;
|
||||
use serde_json::Error as serde_error;
|
||||
use std::{fmt, io::Error as io_error};
|
||||
use subprocess::PopenError as popen_error;
|
||||
use telegram_bot::Error as tg_error;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum Error {
|
||||
pub enum Error {
|
||||
UserNotFound,
|
||||
SQLITE3Error(sqlite_error),
|
||||
TelegramError(tg_error),
|
||||
@ -16,6 +17,7 @@ pub(crate) enum Error {
|
||||
IOError(io_error),
|
||||
FileNotFound,
|
||||
JsonParseError(serde_error),
|
||||
PopenError(popen_error),
|
||||
}
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
@ -52,3 +54,9 @@ impl From<serde_error> for Error {
|
||||
return Error::JsonParseError(e);
|
||||
}
|
||||
}
|
||||
|
||||
impl From<popen_error> for Error {
|
||||
fn from(e: popen_error) -> Error {
|
||||
return Error::PopenError(e);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user