I want to get page detailed error message this way: <a href="http://stackoverflow.com/questions/7279046/how-to-get-detailed-error-message-when-qtwebkit-fails-to-load-a-page">http://stackoverflow.com/questions/7279046/how-to-get-detailed-error-message-when-qtwebkit-fails-to-load-a-page</a><div>
<br></div><div>This need reimplement QWebPage.extension <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebpage.html#extension">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebpage.html#extension</a>, and get detail from the second argument ExtensionOption.</div>
<div><br></div><div>Code like this: </div><div><br></div><div><div> def extension(self, extension, info = None, errorPage = None):</div><div> if extension == QtWebKit.QWebPage.ErrorPageExtension:</div><div> content = u"<html><head><title>Failed loading page</title></head><body><h1>Failed loading page (%s)</h1><h2>%s</h2> </body></html>" % (info.errorString, info.url.toString())</div>
<div> errorPage.content = QtCore.QByteArray(content.encode('utf-8'))</div><div> gdata.log(u'Warn: Failed loading [%s] (%s)!' % (info.errorString, info.url.toString() ))</div><div> return True</div>
<div> return True</div></div><div><div><br></div><div>When extension == QtWebKit.QWebPage.ErrorPageExtension, the second argument should be QWebPage.ErrorPageExtensionOption, but it always be QWebPage.ExtensionOption, and can't get the detailed error message from it.</div>
<div><br></div><div>PySide has this problem in earlier versions, it be fixed later with test case <a href="http://pyside.sourcearchive.com/documentation/1.0.1-1/bug__694_8py_source.html">http://pyside.sourcearchive.com/documentation/1.0.1-1/bug__694_8py_source.html</a> . Hope PyQt can fix it.</div>
</div>