From 1f194535dd07a5aac61cb85a158a6ebe2674f998 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Wed, 31 Jul 2024 14:34:22 +0200 Subject: [PATCH] Add error logs for reconnect, disconnect, logout, account history --- .../mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt index 1f9fce543216..85c1e8a050a6 100644 --- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt +++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt @@ -268,10 +268,12 @@ class ManagementService( suspend fun disconnect(): Either = Either.catch { grpc.disconnectTunnel(Empty.getDefaultInstance()).value } + .onLeft { Logger.e("Disconnect error", it) } .mapLeft(ConnectError::Unknown) suspend fun reconnect(): Either = Either.catch { grpc.reconnectTunnel(Empty.getDefaultInstance()).value } + .onLeft { Logger.e("Reconnect error", it) } .mapLeft(ConnectError::Unknown) private suspend fun getTunnelState(): ModelTunnelState = @@ -297,6 +299,7 @@ class ManagementService( suspend fun logoutAccount(): Either = Either.catch { grpc.logoutAccount(Empty.getDefaultInstance()) } + .onLeft { Logger.e("Logout account error", it) } .mapLeft(LogoutAccountError::Unknown) .mapEmpty() @@ -315,6 +318,7 @@ class ManagementService( suspend fun clearAccountHistory(): Either = Either.catch { grpc.clearAccountHistory(Empty.getDefaultInstance()) } + .onLeft { Logger.e("Clear account history error", it) } .mapLeft(ClearAccountHistoryError::Unknown) .mapEmpty()