The right way to handle errors