Skip to content

Commit 9cdaebc

Browse files
committed
Give more informative messages about invariant violations
1 parent f13d9d5 commit 9cdaebc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Control/Distributed/Process/Internal/Primitives.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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: Initial Tracer "
178+
++ "Name Not Found (whereis tracer.initial)"
178179
(Just p) -> act p

0 commit comments

Comments
 (0)