Test more robust regardless of exception representation.