Catch errors that are thrown in the abort handler