mirror of
https://github.com/house-of-vanity/desubot.git
synced 2025-07-08 13:04:06 +00:00
Word save feature.
This commit is contained in:
@ -3,6 +3,7 @@ use rusqlite::Error as sqlite_error;
|
||||
use rusqlite::{named_params, params, Connection, Result};
|
||||
use std::{fmt, io, io::Error as io_error};
|
||||
use telegram_bot::Error as tg_error;
|
||||
use serde_json::Error as serde_error;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum Error {
|
||||
@ -13,6 +14,7 @@ pub(crate) enum Error {
|
||||
ConfNotFound,
|
||||
IOError(io_error),
|
||||
FileNotFound,
|
||||
JsonParseError(serde_error),
|
||||
}
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
@ -42,4 +44,10 @@ impl From<io_error> for Error {
|
||||
fn from(e: io_error) -> Error {
|
||||
return Error::IOError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<serde_error> for Error {
|
||||
fn from(e: serde_error) -> Error {
|
||||
return Error::JsonParseError(e);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user