Nicer error catching