git.iko.soy/distributed-process
on master help sign in
make ProcessExitException's show look nice when reason :: String
commitba0622a877fd5ba4471e50342de47041f046fc26 authorTim Watson <tim@rabbitmq.com> dateWed 16 Jan 2013, 23:46 (14 years ago) parent5f107a0
1 file changed+9−1
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+9−1
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+9−1
@@ -377,7 +377,15 @@ data ProcessExitException =
377377
378378instance Exception ProcessExitException
379379instance Show ProcessExitException where
380− show (ProcessExitException pid _) = "exit-from=" ++ show pid
380+ show = showProcessExit
381+
382+showProcessExit :: ProcessExitException -> String
383+showProcessExit (ProcessExitException pid reason) =
384+ case messageFingerprint reason == fingerprint (undefined :: String) of
385+ True -> "exit-from=" ++ (show pid) ++ ",reason=" ++ decoded
386+ False -> "exit-from=" ++ show pid
387+ where decoded :: String
388+ !decoded = decode (messageEncoding reason)
381389
382390-- | Catches ProcessExitException
383391catchExit :: forall a b . (Show a, Serializable a)