Catch exceptions thrown by state machine.