View Source Protocol.UndefinedError exception (Elixir v1.17.2)

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

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

For example, this code:"A string!", 0)

would raise the following exception:

  protocol: Enumerable,
  value: "A string!",
  # ...