Caught an exception on Mailnag star when internet is not available:
июн 13 09:38:47 vantu5zbook mailnag[1121]: ERROR (2023-06-13 09:38:47): Caught an exception.
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/Mailnag/daemon/mailnagdaemon.py", line 165, in _start
if not self._wait_for_inet_connection():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/Mailnag/daemon/mailnagdaemon.py", line 212, in _wait_for_inet_connection
if self._conntest.is_offline():
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/Mailnag/daemon/conntest.py", line 47, in is_offline
return (not self._monitor.can_reach(Gio.NetworkAddress.new(TEST_HOST, 8080)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gi.repository.GLib.GError: g-resolver-error-quark: Ошибка разрешения «www.google.com»: Временный сбой в разрешении имен (1)
Caught an exception on Mailnag star when internet is not available:
To fix this, we can use
try
like this:About function Gio.NetworkMonitor.can_reach