Slightly confused - is the `endswith` check necessary?

I would imagine `element.tag` attribute already contains just the tag name so doing just the `tag == 'Error'` check should be enough?