Wayfinder.Error exception (Wayfinder Ex v0.1.4)

View Source

Custom Wayfinder-specific error struct and reason definitions.

Summary

Functions

Creates a new Wayfinder.Error.

Types

reason()

@type reason() ::
  :processor_failure
  | :router_invalid
  | :otp_app_invalid
  | :route_build_error
  | :tree_build_error
  | :filesystem_error
  | :pattern_invalid
  | :unknown

t()

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

Functions

new(message, reason \\ :unknown)

@spec new(String.t(), reason()) :: t()

Creates a new Wayfinder.Error.

Examples

iex> Wayfinder.Error.new("Failed to build tree", :tree_build_error)
%Wayfinder.Error{message: "Failed to build tree", reason: :tree_build_error}