Catches exceptions