35 lines
717 B
Rust
35 lines
717 B
Rust
use thiserror::Error;
|
|
|
|
#[derive (Debug, Error, PartialEq)]
|
|
pub enum MarkdownError {
|
|
#[error ("File is too big to process")]
|
|
TooBig,
|
|
|
|
#[error ("File is not UTF-8")]
|
|
NotUtf8,
|
|
}
|
|
|
|
#[derive (Debug, Error)]
|
|
pub enum FileServerError {
|
|
#[error ("Handlebars render error")]
|
|
Handlebars (#[from] handlebars::RenderError),
|
|
|
|
#[error ("I/O error")]
|
|
Io (#[from] std::io::Error),
|
|
|
|
#[error ("Request path is not UTF-8")]
|
|
PathNotUtf8 (std::str::Utf8Error),
|
|
|
|
#[error ("Can't get file metadata")]
|
|
CantGetFileMetadata (std::io::Error),
|
|
|
|
#[error ("No file name requested")]
|
|
NoFileNameRequested,
|
|
|
|
#[error ("File path is not UTF-8")]
|
|
FilePathNotUtf8,
|
|
|
|
#[error ("Markdown error")]
|
|
Markdown (#[from] MarkdownError),
|
|
}
|