View Source MatchError exception (Elixir v1.17.0)

An exception raised when a pattern match (=/2) fails.

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

  • :term (term/0) - the term that did not match the pattern

For example, this exception gets raised for code like this:

[_ | _] = []