Replaces two identical exceptions with a single one.