Handles errors without crashing using domain module