diff --git a/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift b/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift index 224174a..3addcd4 100644 --- a/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift +++ b/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift @@ -61,6 +61,15 @@ final class CoderVPNService: NSObject, VPNService { if tunnelState == .connecting { progress = .init(stage: .initial, downloadProgress: nil) } + if case let .failed(tunnelError) = tunnelState, tunnelState != oldValue { + Task { + do { + try await sendNotification(title: "Coder Connect has failed!", body: tunnelError.description) + } catch let notifError { + logger.error("Failed to send notification (\(tunnelError.description)): \(notifError)") + } + } + } } }