From 99626f38828eb2451354bb67e54f9a4fb745247b Mon Sep 17 00:00:00 2001 From: Tavis Rudd Date: Sat, 19 Apr 2014 23:19:20 -0700 Subject: [PATCH] be more specific with `die` reasons in Supervisor Several calls to `die` were using opaque reasons that were unhelpful to developers during debugging. --- src/Control/Distributed/Process/Platform/Supervisor.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Control/Distributed/Process/Platform/Supervisor.hs b/src/Control/Distributed/Process/Platform/Supervisor.hs index b501c0b..da722d1 100644 --- a/src/Control/Distributed/Process/Platform/Supervisor.hs +++ b/src/Control/Distributed/Process/Platform/Supervisor.hs @@ -719,7 +719,7 @@ injectIt proc' supervisor sendPidPort = do addr <- proc' supervisor mPid <- resolve addr case mPid of - Nothing -> die "UnresolvableAddress" + Nothing -> die "UnresolvableAddress in startChild instance" Just p -> sendChan sendPidPort p expectTriple :: Process (ProcessId, ChildKey, SendPort ProcessId) @@ -1524,7 +1524,7 @@ doStartChild spec st = do let mState = updateChild chKey (chRunning p) st case mState of -- TODO: better error message if the child is unrecognised - Nothing -> die "InternalError" + Nothing -> die $ "InternalError in doStartChild " ++ show spec Just s' -> return $ Right $ (p, markActive s' p spec) where chKey = childKey spec