Search results

There are no results.

wobsite.PageError

class 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:

  1. The path of the file that couldn't be parsed
  2. The IO error that occurred

FrontMatter

FrontMatter(Path, FrontMatterError)

The JSON front matter is invalid.

The arguments of this case are:

  1. The path of the file that couldn't be parsed
  2. The error produced while parsing the front matter.

Markdown

Markdown(Path, String)

The Markdown is invalid.

The arguments of this case are:

  1. The path of the file that couldn't be parsed
  2. An error message produced while parsing the Markdown

Instance methods

to_string

Show source code
Hide 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

std.string.

ToString

impl ToString for PageError