Formalized that behavior into exceptions? Last I checked using exceptions for control flow was a BAD practice.
In c at least, breaking out of an error condition is still best handled with a goto (where you can clean up all matter of memory in an organized fashion without littering your code with if elses).