git.iko.soy/distributed-process
on master help sign in
make ProcessExitException's show look nice when reason :: String
ba0622aTim Watson
distributed-process/src/Control/Distributed/Process/Internal/Primitives.hs+9−1
@@ -377,7 +377,15 @@ data ProcessExitException =
377
377
378instance Exception ProcessExitException
378instance Exception ProcessExitException
379instance Show ProcessExitException where
379instance Show ProcessExitException where
380+ show = showProcessExit
381+
382+showProcessExit :: ProcessExitException -> String
380− show (ProcessExitException pid _) = "exit-from=" ++ show pid
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)
381
389
382-- | Catches ProcessExitException
390-- | Catches ProcessExitException
383catchExit :: forall a b . (Show a, Serializable a)
391catchExit :: forall a b . (Show a, Serializable a)