Handle errors without crashing (especially division by 0)