Partially revert 6618c24 to allow more types of exceptions