FunctionClauseError — Elixir v1.16.3

Search documentation of Elixir

# View Source FunctionClauseError exception (Elixir v1.16.3)

An exception raised when a function call doesn't match any defined clause.

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

- `:module` (`module/0`) - the module name
- `:function` (`atom/0`) - the function name
- `:arity` (`non_neg_integer/0`) - the arity of the function

For example, if you try to call a function such as `URI.parse/1` with something other than a string, the error would look like:

    %FunctionClauseError{
      module: URI,
      function: :parse,
      arity: 1,
      # Other private fields...
    }