fetchLastDisconnectError(completionHandler:)
Retrives the most recent error that caused the VPN to disconnect.
Declaration
func fetchLastDisconnectError(completionHandler handler: @escaping @Sendable ((any Error)?) -> Void)func fetchLastDisconnectError() async throwsParameters
- handler:
An error handler that receives the last disconnect error as a parameter.
Discussion
If VPN system (including the IPsec client) generated the error, then the error uses the NEVPNConnectionErrorDomain error domain. If the error came from a tunnel provider app extension instead, then the error is the NSError that the provider passed when disconnecting the tunnel.