Skip to content

Commit 9d5e3e6

Browse files
committed
Merge pull request haskell-distributed#86 from BirdseyeSoftware/feature-improve-logging-in-tryStartChild
add logging to ChildInitFailure handler
2 parents 55687af + b62fe1f commit 9d5e3e6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Control/Distributed/Process/Platform/Supervisor.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,13 @@ filterInitFailures :: ProcessId
13401340
-> Process ()
13411341
filterInitFailures sup pid ex = do
13421342
case ex of
1343-
ChildInitFailure _ -> liftIO $ throwIO ex
1343+
ChildInitFailure _ -> do
1344+
-- This is used as a `catches` handler in multiple places
1345+
-- and matches first before the other handlers that
1346+
-- would call logFailure.
1347+
-- We log here to avoid silent failure in those cases.
1348+
logEntry Log.error $ mkReport "ChildInitFailure" sup (show pid) (show ex)
1349+
liftIO $ throwIO ex
13441350
ChildInitIgnore -> Unsafe.cast sup $ IgnoreChildReq pid
13451351

13461352
--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)