Replace aborts with error classes.