Meeseeks.Error exception (Meeseeks v0.17.0) View Source

Meeseeks.Error provides a generic error struct implementing the Exception behaviour and containing three keys: type, reason, and metadata.

  • type is an atom classifying the general context the error exists in, such as :parser.

  • reason is an atom classifying the general problem, such as :invalid_input.

  • metadata is a map containing any additional information useful for debugging the error, such as %{input: "..."}.

Meeseeks Errors:

  • %Meeseeks.Error{type: :context, reason: :accumulator_required}
  • %Meeseeks.Error{type: :css_selector, reason: :invalid}
  • %Meeseeks.Error{type: :css_selector, reason: :invalid_input}
  • %Meeseeks.Error{type: :css_selector_parser, reason: :invalid_input}
  • %Meeseeks.Error{type: :css_selector_tokenizer, reason: :invalid_input}
  • %Meeseeks.Error{type: :document, reason: :unknown_node}
  • %Meeseeks.Error{type: :parser, reason: :invalid_input}
  • %Meeseeks.Error{type: :select, reason: :no_match}
  • %Meeseeks.Error{type: :select, reason: :invalid_selectors}
  • %Meeseeks.Error{type: :xpath_expression, reason: :invalid_arguments}
  • %Meeseeks.Error{type: :xpath_expression, reason: :invalid_evaluated_arguments}
  • %Meeseeks.Error{type: :xpath_expression_parser, reason: :invalid_input}
  • %Meeseeks.Error{type: :xpath_selector, reason: :invalid}
  • %Meeseeks.Error{type: :xpath_selector, reason: :invalid_input}

Link to this section Summary

Functions

Lists a mapping of error types to reasons for all possible Meeseeks errors.

Creates a new %Meeseeks.Error{}.

Link to this section Types

Specs

metadata() :: %{required(any()) => any()}

Specs

reason() :: atom()

Specs

t() :: %Meeseeks.Error{
  __exception__: true,
  metadata: metadata(),
  reason: reason(),
  type: type()
}

Specs

type() :: atom()

Link to this section Functions

Specs

list_errors() :: %{required(type()) => [reason()]}

Lists a mapping of error types to reasons for all possible Meeseeks errors.

Link to this function

new(type, reason, metadata \\ %{})

View Source

Specs

new(type(), reason(), metadata()) :: t()

Creates a new %Meeseeks.Error{}.