Improve error handling in TTC and data-driven modes