# `BadArityError`
[🔗](https://github.com/elixir-lang/elixir/blob/v1.20.1/lib/elixir/lib/exception.ex#L1650)

An exception raised when a function is called with the wrong number of arguments.

For example:

    my_function = fn x, y -> x + y end
    my_function.(42)
    ** (BadArityError) #Function<41.39164016/2 in :erl_eval.expr/6> with arity 2 called with 1 argument (42)

---

*Consult [api-reference.md](api-reference.md) for complete listing*
