How do you prevent Traveling to a new Level if connection the Server has Timed Out?

I have a multiplayer menu, and in that menu you can click a button to connect to a server and load into the server’s level. This is done using the [UGameplayStatics::OpenLevel()] function.

But during testing, if the server is ‘down’ and the player can’t connect to it, clicking the button still causes the player to travel to the level. It’s just not connected to the server.

Is there a way to prevent travel to the level if the connection to the server times out?