LeXtract.Error.Invalid.Template exception (lextract v0.1.2)
View SourceError for invalid template structure or content.
Raised when template data is malformed, missing required fields, or has invalid structure.
Examples
iex> error = LeXtract.Error.Invalid.Template.exception(
...> reason: "Template must have a non-empty description"
...> )
iex> Exception.message(error)
"Invalid template: Template must have a non-empty description"
iex> error = LeXtract.Error.Invalid.Template.exception(
...> reason: "Examples must be a list",
...> template_path: "/tmp/template.json"
...> )
iex> String.contains?(Exception.message(error), "/tmp/template.json")
true
Summary
Functions
Create an Elixir.LeXtract.Error.Invalid.Template without raising it.
Formats the error message for template validation errors.
Types
Functions
@spec exception(opts :: Keyword.t()) :: %LeXtract.Error.Invalid.Template{ __exception__: true, bread_crumbs: term(), class: term(), path: term(), reason: term(), splode: term(), stacktrace: term(), template_path: term(), vars: term() }
Create an Elixir.LeXtract.Error.Invalid.Template without raising it.
Keys
- :reason
- :template_path
Formats the error message for template validation errors.