git.iko.soy/distributed-process
on master help sign in
Give more informative messages about invariant violations
9a316dbTim Watson
src/Control/Distributed/Process/Internal/Primitives.hs+2−1
@@ -403,7 +403,8 @@ receiveWait ms = do
403 mProc <- liftIO $ dequeue queue Blocking (map unMatch ms)
403 mProc <- liftIO $ dequeue queue Blocking (map unMatch ms)
404 case mProc of
404 case mProc of
405 Just proc' -> proc'
405 Just proc' -> proc'
406− Nothing -> error "Well... That wasn't supposed to happen! o_O"
406+ Nothing -> die $ "System Invariant Violation: CQueue.hs returned `Nothing` "
407+ ++ "in the absence of a timeout value."
407
408
408-- | Like 'receiveWait' but with a timeout.
409-- | Like 'receiveWait' but with a timeout.
409--
410--
src/Control/Distributed/Process/Management/Internal/Trace/Primitives.hs+2−1
@@ -174,5 +174,6 @@ withRegisteredTracer act = do
174 -- is not considered cool in later versions of MonadFail
174 -- is not considered cool in later versions of MonadFail
175 case mTP of
175 case mTP of
176 Just p' -> act p'
176 Just p' -> act p'
177− Nothing -> die "Initial Tracer Name Not Registered"
177+ Nothing -> die $ "System Invariant Violation: Tracer Process "
178+ ++ "Name Not Found (whereis tracer.initial)"
178 (Just p) -> act p
179 (Just p) -> act p