From d49dc201c3c243d6404abb431c008534e3dc2fcd Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin Date: Mon, 28 Oct 2024 10:25:15 +0000 Subject: [PATCH] smp server: log file name on hClose error --- src/Simplex/Messaging/Server/MsgStore/Journal.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Simplex/Messaging/Server/MsgStore/Journal.hs b/src/Simplex/Messaging/Server/MsgStore/Journal.hs index d40abc67f..28e52f8e1 100644 --- a/src/Simplex/Messaging/Server/MsgStore/Journal.hs +++ b/src/Simplex/Messaging/Server/MsgStore/Journal.hs @@ -632,7 +632,10 @@ openFile f mode = do pure h hClose :: Handle -> IO () -hClose h = IO.hClose h `catchAny` (\e -> logError $ "STORE: hClose, error closing file, " <> tshow e) +hClose h = + IO.hClose h `catchAny` \e -> do + name <- IO.hShow h + logError $ "STORE: hClose, " <> T.pack name <> ", " <> tshow e closeOnException :: Handle -> IO a -> IO a closeOnException h a = a `E.onException` hClose h