Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 通过NEVPNManager连接时,是否有方法获取授权错误。共享()。connection.startVPNTunnel()?_Ios_Swift_Vpn_Nevpnmanager - Fatal编程技术网

Ios 通过NEVPNManager连接时,是否有方法获取授权错误。共享()。connection.startVPNTunnel()?

Ios 通过NEVPNManager连接时,是否有方法获取授权错误。共享()。connection.startVPNTunnel()?,ios,swift,vpn,nevpnmanager,Ios,Swift,Vpn,Nevpnmanager,如果我们指定了正确的用户名和密码,连接将正常执行。如果我们指定了一个不存在的用户名或密码,连接就会失败。除了无法识别未建立连接的问题外,一切都很好。我想告诉用户有关断开连接原因的正确信息。可能吗 下面是调用启动连接函数的代码。以防万一-此处捕获错误处理块仅获取与错误VPN配置相关的错误 print(“VPN STARTING tunnel”) do { try self.manager.connection.startVPNTunnel() } catch let error as NS

如果我们指定了正确的用户名和密码,连接将正常执行。如果我们指定了一个不存在的用户名或密码,连接就会失败。除了无法识别未建立连接的问题外,一切都很好。我想告诉用户有关断开连接原因的正确信息。可能吗

下面是调用启动连接函数的代码。以防万一-此处捕获错误处理块仅获取与错误VPN配置相关的错误

print(“VPN STARTING tunnel”)
do {
    try self.manager.connection.startVPNTunnel()
} catch let error as NSError {
    print(“##ERROR”, error.localizedDescription)
    print(error.localizedDescription)
}