handle dns errors on new url
This commit is contained in:
parent
304c0737f4
commit
5f615c6e9a
|
@ -2,7 +2,7 @@ import cairo
|
|||
import threading
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from dns.resolver import NXDOMAIN
|
||||
from dns.resolver import NXDOMAIN, NoAnswer
|
||||
from izzylib.exceptions import DNSResolverError
|
||||
from izzylib.misc import class_name
|
||||
from izzylib.url import Address
|
||||
|
@ -519,7 +519,7 @@ class WebTab(BuilderBase, Gtk.Box):
|
|||
url = Url(f'{proto}://{full_url}')
|
||||
|
||||
except ValueError:
|
||||
return self.window.notification(f'Not a valid url: {full_url}')
|
||||
return run_in_gui_thread(self.window.notification, f'Not a valid url: {full_url}')
|
||||
|
||||
else:
|
||||
url = Url(full_url)
|
||||
|
@ -555,8 +555,8 @@ class WebTab(BuilderBase, Gtk.Box):
|
|||
port = 80 if url.port == 443 else url.port
|
||||
)
|
||||
|
||||
except NXDOMAIN:
|
||||
pass
|
||||
except (NXDOMAIN, NoAnswer):
|
||||
return run_in_gui_thread(self.window.notification, f'Failed to resolve domain: {url.domain}')
|
||||
|
||||
if not address:
|
||||
search = s.get_search(keyword, default=True)
|
||||
|
|
Reference in a new issue