LeXtract.Error.Processing.Parsing exception (lextract v0.1.2)
View SourceError for JSON/YAML parsing failures.
Raised when text cannot be parsed in the expected format.
Examples
iex> error = LeXtract.Error.Processing.Parsing.exception(
...> format: :json,
...> reason: "unexpected token at position 5"
...> )
iex> String.contains?(Exception.message(error), "JSON")
true
iex> error = LeXtract.Error.Processing.Parsing.exception(
...> format: :yaml,
...> reason: "invalid indentation",
...> content_sample: "key:value\n bad"
...> )
iex> String.contains?(Exception.message(error), "YAML")
true
Summary
Functions
Create an Elixir.LeXtract.Error.Processing.Parsing without raising it.
Formats the error message for parsing failures.
Types
Functions
@spec exception(opts :: Keyword.t()) :: %LeXtract.Error.Processing.Parsing{ __exception__: true, bread_crumbs: term(), class: term(), content_sample: term(), format: term(), path: term(), reason: term(), splode: term(), stacktrace: term(), vars: term() }
Create an Elixir.LeXtract.Error.Processing.Parsing without raising it.
Keys
- :format
- :reason
- :content_sample
Formats the error message for parsing failures.