Give more informative messages about invariant violations
commit9a316dbfec3b9936966cf630ac7cf8c0c218753e
authorTim Watson <watson.timothy@gmail.com>
dateSat 10 Nov 2018, 21:23 (8 years ago)
parentf8533f0
src/Control/Distributed/Process/Internal/Primitives.hs+2−1
@@ -403,7 +403,8 @@ receiveWait ms = do
403403 mProc <- liftIO $ dequeue queue Blocking (map unMatch ms)
404404 case mProc of
405405 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."
407408
408409-- | Like 'receiveWait' but with a timeout.
409410--
src/Control/Distributed/Process/Management/Internal/Trace/Primitives.hs+2−1
@@ -174,5 +174,6 @@ withRegisteredTracer act = do
174174 -- is not considered cool in later versions of MonadFail
175175 case mTP of
176176 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)"
178179 (Just p) -> act p