# `Ussd.ExceptionHandler`
[🔗](https://github.com/spesohq/ussd/blob/main/lib/ussd/exception_handler.ex#L1)

Turns an exception raised while running a flow into a message the caller sees,
instead of a dead session.

    defmodule MyApp.UssdErrors do
      @behaviour Ussd.ExceptionHandler

      @impl Ussd.ExceptionHandler
      def handle(_exception), do: "Sorry, something went wrong. Please try again."
    end

Wired in via `Ussd.use_exception_handler/2`, either as a module implementing this
behaviour or as a 1-arity function.

# `handle`

```elixir
@callback handle(Exception.t()) :: String.t()
```

Turns `exception` into the message the caller sees. The session always ends after this.

---

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