Skip to content

Commit

Permalink
Add error logs for reconnect, disconnect, logout, account history
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Jul 31, 2024
1 parent 576ef19 commit 1f19453
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,12 @@ class ManagementService(

suspend fun disconnect(): Either<ConnectError, Boolean> =
Either.catch { grpc.disconnectTunnel(Empty.getDefaultInstance()).value }
.onLeft { Logger.e("Disconnect error", it) }
.mapLeft(ConnectError::Unknown)

suspend fun reconnect(): Either<ConnectError, Boolean> =
Either.catch { grpc.reconnectTunnel(Empty.getDefaultInstance()).value }
.onLeft { Logger.e("Reconnect error", it) }
.mapLeft(ConnectError::Unknown)

private suspend fun getTunnelState(): ModelTunnelState =
Expand All @@ -297,6 +299,7 @@ class ManagementService(

suspend fun logoutAccount(): Either<LogoutAccountError, Unit> =
Either.catch { grpc.logoutAccount(Empty.getDefaultInstance()) }
.onLeft { Logger.e("Logout account error", it) }
.mapLeft(LogoutAccountError::Unknown)
.mapEmpty()

Expand All @@ -315,6 +318,7 @@ class ManagementService(

suspend fun clearAccountHistory(): Either<ClearAccountHistoryError, Unit> =
Either.catch { grpc.clearAccountHistory(Empty.getDefaultInstance()) }
.onLeft { Logger.e("Clear account history error", it) }
.mapLeft(ClearAccountHistoryError::Unknown)
.mapEmpty()

Expand Down

0 comments on commit 1f19453

Please sign in to comment.