Exception raised when an invalid FSM transition is attempted and the
on_invalid_transition policy is :raise (the default).
Fields
message- human-readable error messagefrom- the source state atomto- the attempted target state atom
Example
# When :raise policy is active:
transition(context, :confirm)
# => raises %ExGram.FSM.TransitionError{from: :idle, to: :confirm, ...}Handling in the bot
def handle_error(%ExGram.Error{error: %ExGram.FSM.TransitionError{from: from, to: to}}) do
Logger.error("Invalid FSM transition: #{from} -> #{to}")
end