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."
endWired in via Ussd.use_exception_handler/2, either as a module implementing this
behaviour or as a 1-arity function.
Summary
Callbacks
@callback handle(Exception.t()) :: String.t()
Turns exception into the message the caller sees. The session always ends after this.