Exception handling in automaton