Browse Source

Show error message on gaierror

pull/3/head
Richard Neumann 4 years ago
parent
commit
0251b2e19d
  1. 4
      rcon/gui.py

4
rcon/gui.py

@ -5,7 +5,7 @@ from json import dump, load
from logging import DEBUG, INFO, basicConfig, getLogger from logging import DEBUG, INFO, basicConfig, getLogger
from os import getenv, name from os import getenv, name
from pathlib import Path from pathlib import Path
from socket import timeout from socket import gaierror, timeout
from typing import Iterable, NamedTuple from typing import Iterable, NamedTuple
from gi import require_version from gi import require_version
@ -204,6 +204,8 @@ class GUI(Gtk.Window): # pylint: disable=R0902
result = self.run_rcon() result = self.run_rcon()
except ValueError as error: except ValueError as error:
self.show_error(str(error)) self.show_error(str(error))
except gaierror as error:
self.show_error(error.strerror)
except ConnectionRefusedError: except ConnectionRefusedError:
self.show_error('Connection refused.') self.show_error('Connection refused.')
except (TimeoutError, timeout): except (TimeoutError, timeout):

Loading…
Cancel
Save