Handle more types of exceptions.