how to catch Network.InitializeServer errors?

Hi,

I am a bit puzzled by this, hopefully this is just something silly:

I am not connected to the internet and I try to use Network.InitializeServer and I am getting the following:

try
		{
			var error = Network.InitializeServer(32, 25001, true);
			Debug.Log(error);
		}catch(System.Exception e)
		{
			Debug.Log("catched error : "+e.Message);
		}

I get the following error:

Cannot resolve facilitator address,
make sure you are connected to the
internet before connecting to a server
with NAT punchthrough enabled
UnityEngine.Network:InitializeServer(Int32,
Int32, Boolean)

So if the user is not connected to the internet, How can I efficiently detect this end prevent errors? because Application.internetReachability is not reliable,

Thanks for your help,

Jean

InitializeServer returns a NetworkConnectionError, so you’ll want to check that it == NetworkConnectionError.NoError, else: do your error handling.