From 0251b2e19d2a0f198aed3bbf04391d8e88d97674 Mon Sep 17 00:00:00 2001 From: Richard Neumann Date: Thu, 17 Jun 2021 15:21:31 +0200 Subject: [PATCH] Show error message on gaierror --- rcon/gui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rcon/gui.py b/rcon/gui.py index b9a2c2f..92d1d59 100644 --- a/rcon/gui.py +++ b/rcon/gui.py @@ -5,7 +5,7 @@ from json import dump, load from logging import DEBUG, INFO, basicConfig, getLogger from os import getenv, name from pathlib import Path -from socket import timeout +from socket import gaierror, timeout from typing import Iterable, NamedTuple from gi import require_version @@ -204,6 +204,8 @@ class GUI(Gtk.Window): # pylint: disable=R0902 result = self.run_rcon() except ValueError as error: self.show_error(str(error)) + except gaierror as error: + self.show_error(error.strerror) except ConnectionRefusedError: self.show_error('Connection refused.') except (TimeoutError, timeout):