(page)
return retVal
Returns reported error message from page if it founds one

    >>> extractErrorMessage(u'<html><title>Test</title>\\n<b>Warning</b>: oci_parse() [function.oci-parse]: ORA-01756: quoted string not properly terminated<br><p>Only a test page</p></html>')
    u'oci_parse() [function.oci-parse]: ORA-01756: quoted string not properly terminated'
Returns reported error message from page if it founds one
Returns reported error message from page if it founds one
def extractErrorMessage(page):
    """
    Returns reported error message from page if it founds one

    >>> extractErrorMessage(u'<html><title>Test</title>\\n<b>Warning</b>: oci_parse() [function.oci-parse]: ORA-01756: quoted string not properly terminated<br><p>Only a test page</p></html>')
    u'oci_parse() [function.oci-parse]: ORA-01756: quoted string not properly terminated'
    """

    retVal = None

    if isinstance(page, basestring):
        for regex in ERROR_PARSING_REGEXES:
            match = re.search(regex, page, re.DOTALL | re.IGNORECASE)

            if match:
                retVal = htmlunescape(match.group("result")).replace("<br>", "\n").strip()
                break

    return retVal
def extractErrorMessage ( page ) : retVal = None if isinstance ( page , basestring ) : for regex in ERROR_PARSING_REGEXES : match = re . search ( regex , page , re . DOTALL | re . IGNORECASE ) if match : retVal = htmlunescape ( match . group ( "result" ) ) . replace ( "<br>" , "\n" ) . strip ( ) break return retVal