Enum tpnote_lib::error::NoteError
source · [−]pub enum NoteError {
Show 15 variants
Read {
path: PathBuf,
source: Error,
},
CannotPrependHeader {
existing_header: String,
},
TeraTemplate {
source_str: String,
template_str: String,
},
Tera {
source: Error,
},
MissingFrontMatterField {
field_name: String,
},
CompulsoryFrontMatterFieldIsEmpty {
field_name: String,
},
InvalidFrontMatterYaml {
front_matter: String,
source_error: Error,
},
InvalidInputYaml {
tmpl_var: String,
source_str: String,
},
MissingFrontMatter {
compulsory_field: String,
},
SortTagVarInvalidChar {
sort_tag: String,
sort_tag_chars: String,
},
FileExtNotRegistered {
extension: String,
md_ext: Vec<String>,
rst_ext: Vec<String>,
html_ext: Vec<String>,
txt_ext: Vec<String>,
no_viewer_ext: Vec<String>,
},
RstParse {
msg: String,
},
Utf8Conversion {
source: Utf8Error,
},
File(FileError),
Io(Error),
}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
Fields
existing_header: StringRemedy: report this error. It should not happen.
TeraTemplate
Remedy: check the syntax of the Tera template in the configuration file.
Tera
Fields
source: ErrorRemedy: restart with --debug trace.
MissingFrontMatterField
Fields
field_name: StringRemedy: add the missing field in the note’s front matter.
CompulsoryFrontMatterFieldIsEmpty
Fields
field_name: StringRemedy: enter a string.
InvalidFrontMatterYaml
Remedy: check YAML syntax in the note’s front matter.
InvalidInputYaml
Remedy: check YAML syntax in the input stream’s front matter.
MissingFrontMatter
Fields
compulsory_field: StringRemedy: check front matter delimiters ----.
SortTagVarInvalidChar
Remedy: remove invalid characters.
FileExtNotRegistered
Fields
extension: StringRemedy: correct the front matter variable file_ext.
RstParse
Fields
msg: StringRemedy: check reStructuredText syntax.
Utf8Conversion
Fields
source: Utf8ErrorFile(FileError)
Io(Error)
Trait Implementations
sourceimpl Error for NoteError
impl Error for NoteError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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,
fn as_fail(&self) -> &(dyn Fail + 'static)
fn as_fail(&self) -> &(dyn Fail + 'static)
Converts a reference to
Self into a dynamic trait object of Fail.sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<E> Fail for Ewhere
E: 'static + Error + Send + Sync,
impl<E> Fail for Ewhere
E: 'static + Error + Send + Sync,
fn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
Returns a reference to the underlying cause of this failure, if it
is an error that wraps other errors. Read more
fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the
Backtrace carried by this failure, if it
carries one. Read more