wobsite.PageError
type pub enum PageError
An error that may be produced when parsing a Markdown document.
Constructors
Io
Io(Path, Error)
An IO operation (such as reading the Markdown file) failed.
The arguments of this case are:
- The path of the file that couldn't be parsed
- The IO error that occurred
FrontMatter
FrontMatter(Path, FrontMatterError)
The JSON front matter is invalid.
The arguments of this case are:
- The path of the file that couldn't be parsed
- The error produced while parsing the front matter.
Markdown
Markdown(Path, String)
The Markdown is invalid.
The arguments of this case are:
- The path of the file that couldn't be parsed
- An error message produced while parsing the Markdown
Instance methods
to_string
Show source codeHide source code
fn pub to_string -> String {
match self {
case Io(p, e) -> 'failed to read ${p}: ${e}'
case FrontMatter(p, InvalidJson(m)) -> {
'failed to parse the front matter of ${p}: ${m}'
}
case FrontMatter(p, m) -> 'failed to parse the front matter of ${p}: ${m}'
case Markdown(p, v) -> 'failed to parse the Markdown of ${p}: ${v}'
}
}
fn pub to_string -> String
Converts self
to a String
.
Implemented traits
ToString
impl ToString for PageError