diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-11-21 21:22:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-11-21 21:32:51 -0400 |
commit | 3ea7198d9e0aea3f8764c0b991c18b09f32d2de1 (patch) | |
tree | 23d396798f4342efc6afc2acd3900b9ba1c0e0cc /CmdLine | |
parent | f0f7e900cc9248c05314eaed418317de690a24d8 (diff) |
stop cleanly when there's a IO error accessing the Handle
All other exceptions are let through, but IO errors accessing the handle
are to be expected, so quietly ignore.
Diffstat (limited to 'CmdLine')
-rw-r--r-- | CmdLine/GitRemoteTorAnnex.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CmdLine/GitRemoteTorAnnex.hs b/CmdLine/GitRemoteTorAnnex.hs index 77fadc63e..f3c3a81ae 100644 --- a/CmdLine/GitRemoteTorAnnex.hs +++ b/CmdLine/GitRemoteTorAnnex.hs @@ -32,7 +32,8 @@ run (_remotename:address:[]) = forever $ do | otherwise = parseAddressPort address go service = do ready - connectService onionaddress onionport service >>= exitWith + res <- connectService onionaddress onionport service + exitWith (fromMaybe (ExitFailure 1) res) ready = do putStrLn "" hFlush stdout @@ -47,7 +48,7 @@ parseAddressPort s = Nothing -> giveup "onion address must include port number" Just p -> (OnionAddress a, p) -connectService :: OnionAddress -> OnionPort -> Service -> IO ExitCode +connectService :: OnionAddress -> OnionPort -> Service -> IO (Maybe ExitCode) connectService address port service = do state <- Annex.new =<< Git.CurrentRepo.get Annex.eval state $ do |