Markup.Error exception (Markup v0.1.0)

Copy Markdown View Source

Raised (or returned) by the core when it can't resolve a language, a format isn't supported, or some other core-level operation fails.

Reasons:

  • :no_languages - no language package is installed
  • :ambiguous_language - several are installed and none was chosen
  • {:unknown_language, id} - id names no installed language
  • {:unsupported_format, language_id, format} - the language cannot render format
  • {:safe_html, reason} - Markup.safe_html/2 failed
  • :sanitize_unsupported_in_heex - sanitize: combined with HEEx rendering

Parse and render failures come back as the language's own exception (e.g. Markup.Djot.Error).

Summary

Types

t()

@type t() :: %Markup.Error{__exception__: term(), message: String.t(), reason: term()}