I created a static HTML window in my wxPython application with:
wx.html.HtmlWindow.LoadPage(url)
It works well, and displays the HTML window in the application.
I am looking for a way to do exception handling for it, in case the website or Internet access is down, and it is unable to find the webpage link.
I tried two methods:
try:
wx.html.HtmlWindow.LoadPage(url)
except:
...
And:
if wx.html.HtmlWindow.LoadPage(url):
...
else:
...
But for either test, if I use a URL that is not available, I will get a Python error that pops up with "Unable to open requested HTML document...", and the exception handler does not work.
I'd like to be able to handle exceptions and allow the program to continue running.
How can I perform error/exception handling for wx.html.HtmlWindow.LoadPage(...)
?