Fix regression in mapping OpenVPN errors (#404)

This commit is contained in:
Davide De Rosa 2024-01-05 21:09:04 +01:00 committed by GitHub
parent 138f1ca168
commit a255379679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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/), 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). 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) ## 6.3.1 (2024-01-05)
### Changed ### Changed

View File

@ -684,8 +684,8 @@ private extension OpenVPNTunnelProvider {
} }
func openVPNError(from error: Error) -> TunnelKitOpenVPNError? { func openVPNError(from error: Error) -> TunnelKitOpenVPNError? {
if let specificError = error as? OpenVPNError { if let specificError = error.asNativeOpenVPNError ?? error as? OpenVPNError {
switch specificError.asNativeOpenVPNError ?? specificError { switch specificError {
case .negotiationTimeout, .pingTimeout, .staleSession: case .negotiationTimeout, .pingTimeout, .staleSession:
return .timeout return .timeout