git.iko.soy/distributed-process
on master help sign in
Provide a note about our use of serialisation in `die'
6aa01c6Tim Watson
src/Control/Distributed/Process/Internal/Primitives.hs+3
@@ -577,6 +577,9 @@ terminate = liftIO $ throwIO ProcessTerminationException
577-- | Die immediately - throws a 'ProcessExitException' with the given @reason@.
577-- | Die immediately - throws a 'ProcessExitException' with the given @reason@.
578die :: Serializable a => a -> Process b
578die :: Serializable a => a -> Process b
579die reason = do
579die reason = do
580+-- NOTE: We do /not/ want to use UnencodedMessage here, as the exception
581+-- could be decoded by a handler passed to 'catchExit', re-thrown or even
582+-- passed to another process via the tracing mechanism.
580 pid <- getSelfPid
583 pid <- getSelfPid
581 liftIO $ throwIO (ProcessExitException pid (createMessage reason))
584 liftIO $ throwIO (ProcessExitException pid (createMessage reason))
582
585