def _check_for_errors ( etree : ET . ElementTree ) : if etree . getroot ( ) . tag == 'error' : raise APIError ( etree . getroot ( ) . text )
how to set an xml parser to ignor errors python
Check AniDB response XML tree for errors .
def _check_for_errors(etree: ET.ElementTree):
    """Check AniDB response XML tree for errors."""
    if etree.getroot().tag == 'error':
        raise APIError(etree.getroot().text)