Packages

A MessagePack serialization library for Elixir.

Current section

Files

Jump to
msgpack_elixir lib msgpack unsupported_atom_error.ex
Raw

lib/msgpack/unsupported_atom_error.ex

defmodule Msgpack.UnsupportedAtomError do
@moduledoc """
Error raised by `Msgpack.encode!/2` when an atom is encountered and the
`:atoms` option is set to `:error`.
This provides a strategy for ensuring that atoms, an Elixir-specific type,
are not unintentionally leaked into a serialization format intended for
cross-language interoperability.
"""
defexception [:atom]
@impl true
def message(exception) do
"Cannot encode atom #{inspect(exception.atom)} when `atoms: :error` option is set."
end
end