summaryrefslogtreecommitdiffhomepage
path: root/Role/User.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Role/User.hs')
-rw-r--r--Role/User.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Role/User.hs b/Role/User.hs
index 1d1702e..49c263c 100644
--- a/Role/User.hs
+++ b/Role/User.hs
@@ -27,12 +27,11 @@ import System.Environment
run :: UserOpts -> IO ExitCode
run os = do
(cmd, cmdparams) <- shellCommand os
- go cmd cmdparams startSession
+ fromMaybe (ExitFailure 101) <$> go cmd cmdparams startSession
where
go cmd cmdparams startmsg = do
putStr "Connecting to debug-me server..."
hFlush stdout
- esv <- newEmptyTMVarIO
runClientApp $ clientApp (InitMode mempty) User developerMessages $ \ichan ochan sid -> do
let url = sessionIDUrl sid "localhost" 8081
putStrLn ""
@@ -43,9 +42,8 @@ run os = do
uthread <- async (user startmsg p ichan ochan)
exitstatus <- waitForProcess ph
cancel uthread
- atomically $ putTMVar esv exitstatus
- sessionDone
- fromMaybe (ExitFailure 101) <$> atomically (tryReadTMVar esv)
+ sessionDone
+ return exitstatus
developerMessages :: LogMessage -> Maybe (Message Entered)
developerMessages (Developer m) = Just m