From 267236a4f8d2787d59ad1f9a0be40f3f4eb898dd Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Mon, 26 Dec 2022 13:00:41 +0000 Subject: [PATCH] remove unnecessary exception handler, error format in stats --- src/Simplex/Messaging/Agent/Client.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Simplex/Messaging/Agent/Client.hs b/src/Simplex/Messaging/Agent/Client.hs index b94c1442c..b1814b95d 100644 --- a/src/Simplex/Messaging/Agent/Client.hs +++ b/src/Simplex/Messaging/Agent/Client.hs @@ -312,7 +312,7 @@ getSMPServerClient c@AgentClient {active, smpClients, msgQ} srv = do serverDown :: ([RcvQueue], [ConnId]) -> IO () serverDown (qs, conns) = whenM (readTVarIO active) $ do - incClientStat c client "DISCONNECT" "" `E.catch` \(e :: E.SomeException) -> print e + incClientStat c client "DISCONNECT" "" notifySub "" $ hostEvent DISCONNECT client unless (null conns) $ notifySub "" $ DOWN srv conns unless (null qs) $ do @@ -507,7 +507,7 @@ withClient_ c srv statCmd action = do logServerError :: ProtocolClient msg -> AgentErrorType -> m a logServerError cl e = do logServer "<--" c srv "" $ strEncode e - stat cl $ bshow e + stat cl $ strEncode e throwError e withLogClient_ :: (AgentMonad m, ProtocolServerClient msg) => AgentClient -> ProtoServer msg -> QueueId -> ByteString -> (ProtocolClient msg -> m a) -> m a