Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

revert d225580 (better ProcessExitException show)

It turns out that subtle decoding issues can arise from the given
implementation, and the horrors therein far outweigh any benefits of
being able to print exit reasons which happen to be a string.
  • Loading branch information...
commit a057e3e0f554ce2289fc798157fc6b74af8a4306 1 parent c804296
Tim Watson hyperthunk authored
12 distributed-process/src/Control/Distributed/Process/Internal/Types.hs
View
@@ -73,7 +73,7 @@ import System.Mem.Weak (Weak)
import Data.Map (Map)
import Data.Int (Int32)
import Data.Typeable (Typeable)
-import Data.Binary (Binary(put, get), putWord8, getWord8, encode, decode)
+import Data.Binary (Binary(put, get), putWord8, getWord8, encode)
import qualified Data.ByteString as BSS (ByteString, concat, copy)
import qualified Data.ByteString.Lazy as BSL
( ByteString
@@ -378,15 +378,7 @@ data ProcessExitException =
instance Exception ProcessExitException
instance Show ProcessExitException where
- show = showProcessExit
-
-showProcessExit :: ProcessExitException -> String
-showProcessExit (ProcessExitException pid reason) =
- case messageFingerprint reason == fingerprint (undefined :: String) of
- True -> "origin=" ++ (show pid) ++ ",reason=" ++ decoded
- False -> "origin=" ++ show pid
- where decoded :: String
- !decoded = decode (messageEncoding reason)
+ show (ProcessExitException pid _) = "exit-from=" ++ (show pid)
instance Exception ProcessLinkException
instance Exception NodeLinkException
3  distributed-process/tests/TestCH.hs
View
@@ -1047,8 +1047,7 @@ testPrettyExit transport = do
_ <- forkProcess localNode $ do
(die "timeout")
`catch` \ex@(ProcessExitException from _) ->
- let expected = "origin=" ++ (show from) ++
- ",reason=timeout"
+ let expected = "exit-from=" ++ (show from)
in do
True <- return $ (show ex) == expected
liftIO $ putMVar done ()
Please sign in to comment.
Something went wrong with that request. Please try again.