improved handling network errors (show message instead of stopping program)
authorHolger Schemel <info@artsoft.org>
Sat, 29 Sep 2018 09:07:53 +0000 (11:07 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 29 Sep 2018 09:07:53 +0000 (11:07 +0200)
src/network.c

index eb2c5bd..1b9a138 100644 (file)
@@ -284,7 +284,16 @@ boolean ConnectToServer(char *hostname, int port)
     SDLNet_ResolveHost(&ip, hostname, port);
 
     if (ip.host == INADDR_NONE)
-      Error(ERR_EXIT, "cannot locate host '%s'", hostname);
+    {
+      char message[100];
+
+      sprintf(message, "Failed to resolve network server hostname '%s'!",
+             hostname);
+
+      DrawNetworkText_Failed(message);
+
+      return FALSE;
+    }
     else
       server_host = SDLNet_Read32(&ip.host);