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

An exception raised when none of the `else` clauses in a `try/1` match.

For example:

    iex> try do
    ...>   :ok
    ...> rescue
    ...>   e -> e
    ...> else
    ...>   # :ok -> :ok is missing
    ...>   :not_ok -> :not_ok
    ...> end
    ** (TryClauseError) no try clause matching:
    ...

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

  * `:term` (`t:term/0`) - the term that did not match any of the clauses

---

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