Use generic Exception to make tests pass consistently.