Protocol.UndefinedError exception (Elixir v1.20.0-dev)

View Source

An exception raised when a protocol is not implemented for a given value.

For example:

iex> Enum.at("A string!", 0)
** (Protocol.UndefinedError) protocol Enumerable not implemented for BitString
...

The following fields of this exception are public and can be accessed freely:

  • :protocol (module/0) - the protocol that is not implemented
  • :value (term/0) - the value that does not implement the protocol