From a25537967993176d9fc1895e331ca996f0a74022 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 5 Jan 2024 21:09:04 +0100 Subject: [PATCH] Fix regression in mapping OpenVPN errors (#404) --- CHANGELOG.md | 6 ++++++ .../OpenVPNTunnelProvider.swift | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9acfd5c..e1c7c2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- OpenVPN: Bad error mapping. [#404](https://github.com/passepartoutvpn/tunnelkit/pull/404) + ## 6.3.1 (2024-01-05) ### Changed diff --git a/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift b/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift index 29ce986..a844139 100644 --- a/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift +++ b/Sources/TunnelKitOpenVPNAppExtension/OpenVPNTunnelProvider.swift @@ -684,8 +684,8 @@ private extension OpenVPNTunnelProvider { } func openVPNError(from error: Error) -> TunnelKitOpenVPNError? { - if let specificError = error as? OpenVPNError { - switch specificError.asNativeOpenVPNError ?? specificError { + if let specificError = error.asNativeOpenVPNError ?? error as? OpenVPNError { + switch specificError { case .negotiationTimeout, .pingTimeout, .staleSession: return .timeout