Toon.EncodeError exception (toon v0.3.0)

View Source

Exception raised when encoding fails.

This exception is raised when the encoder encounters an error while converting Elixir data structures to TOON format.

Summary

Functions

Creates a new EncodeError.

Types

t()

@type t() :: %Toon.EncodeError{
  __exception__: true,
  message: String.t(),
  reason: term(),
  value: term()
}

Functions

exception(msg)

Creates a new EncodeError.

Examples

iex> Toon.EncodeError.exception(message: "Invalid value", value: :atom)
%Toon.EncodeError{message: "Invalid value", value: :atom, reason: nil}