Skip to content

Commit d49dc20

Browse files
committed
smp server: log file name on hClose error
1 parent 6ff4c3f commit d49dc20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Simplex/Messaging/Server/MsgStore/Journal.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,10 @@ openFile f mode = do
632632
pure h
633633

634634
hClose :: Handle -> IO ()
635-
hClose h = IO.hClose h `catchAny` (\e -> logError $ "STORE: hClose, error closing file, " <> tshow e)
635+
hClose h =
636+
IO.hClose h `catchAny` \e -> do
637+
name <- IO.hShow h
638+
logError $ "STORE: hClose, " <> T.pack name <> ", " <> tshow e
636639

637640
closeOnException :: Handle -> IO a -> IO a
638641
closeOnException h a = a `E.onException` hClose h

0 commit comments

Comments
 (0)