Enum tpnote_lib::error::NoteError
source · pub enum NoteError {
Show 20 variants
Read {
path: PathBuf,
source: Error,
},
CannotPrependHeader {
existing_header: String,
},
TeraTemplate {
source_str: String,
template_str: String,
},
Tera {
source: Error,
},
FrontMatterFieldMissing {
field_name: String,
},
FrontMatterFieldIsNotString {
field_name: String,
},
FrontMatterFieldIsEmptyString {
field_name: String,
},
FrontMatterFieldIsNotNumber {
field_name: String,
},
FrontMatterFieldIsNotBool {
field_name: String,
},
FrontMatterFieldIsCompound {
field_name: String,
},
InvalidFrontMatterYaml {
front_matter: String,
source_error: Error,
},
InvalidInputYaml {
tmpl_var: String,
source_str: String,
},
FrontMatterMissing {
compulsory_field: String,
},
FrontMatterFieldHasNotOnlySortTagChars {
sort_tag: String,
sort_tag_chars: String,
},
FrontMatterFieldIsNotTpnoteExtension {
extension: Box<String>,
md_ext: Box<Vec<String>>,
rst_ext: Box<Vec<String>>,
html_ext: Box<Vec<String>>,
txt_ext: Box<Vec<String>>,
no_viewer_ext: Box<Vec<String>>,
},
RstParse {
msg: String,
},
Utf8Conversion {
source: Utf8Error,
},
File(FileError),
Io(Error),
ParseLanguageCode(LibCfgError),
}Expand description
Error type returned form methods in or related to the note module.
Variants§
Read
Remedy: check the file permission of the note file.
CannotPrependHeader
Remedy: report this error. It should not happen.
TeraTemplate
Remedy: check the syntax of the Tera template in the configuration file.
Tera
Remedy: restart with --debug trace.
FrontMatterFieldMissing
Remedy: add the missing field in the note’s front matter.
FrontMatterFieldIsNotString
Remedy: try to enclose with quotes.
FrontMatterFieldIsEmptyString
Remedy: try to enclose with quotes.
FrontMatterFieldIsNotNumber
Remedy: try to remove possible quotes.
FrontMatterFieldIsNotBool
Remedy: try to remove possible quotes.
FrontMatterFieldIsCompound
Remedy: index the compound type?
InvalidFrontMatterYaml
Remedy: check YAML syntax in the note’s front matter.
InvalidInputYaml
Remedy: check YAML syntax in the input stream’s front matter.
FrontMatterMissing
Remedy: check front matter delimiters ----.
FrontMatterFieldHasNotOnlySortTagChars
Remedy: remove invalid characters.
FrontMatterFieldIsNotTpnoteExtension
Fields
Remedy: correct the front matter variable file_ext.
RstParse
Remedy: check reStructuredText syntax.
Utf8Conversion
File(FileError)
Io(Error)
ParseLanguageCode(LibCfgError)
Trait Implementations§
source§impl Error for NoteError
impl Error for NoteError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<LibCfgError> for NoteError
impl From<LibCfgError> for NoteError
source§fn from(source: LibCfgError) -> Self
fn from(source: LibCfgError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for NoteError
impl Send for NoteError
impl Sync for NoteError
impl Unpin for NoteError
impl !UnwindSafe for NoteError
Blanket Implementations§
§impl<T> AsFail for Twhere
T: Fail,
impl<T> AsFail for Twhere T: Fail,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<E> Fail for Ewhere
E: Error + Send + Sync + 'static,
impl<E> Fail for Ewhere E: Error + Send + Sync + 'static,
§fn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace carried by this failure, if it
carries one. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere T: Display,
§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more