Network Failure Handling

If the WIFi goes down I start a timer as below; this will trigger the network to reconnect however I get an exception error as well? see image attached.

Is this the correct way of handling a reconnect?

When it disconnects I start a 1 minute timer;

    void networkReconnect_Tick(GT.Timer timer)
    {
        
        Debug.Print("Network Reconnect");


        netif.Close();
        netif.Open();
        netif.EnableDhcp();
        netif.EnableDynamicDns(); 
        netif.Join("TRYW02", "TRYW022012");
    }

@ Robert24 - How are you detecting that wifi goes down?

nertworkavailability protocol, I think you call it a protocol?

@ Robert24 - NetworkAvailabilityChanged?