convert P2P runners from Maybe to Either String
So we get some useful error messages when things fail. This commit was sponsored by Peter Hogg on Patreon.
This commit is contained in:
parent
c05f4eb631
commit
af41519126
7 changed files with 69 additions and 54 deletions
|
@ -92,10 +92,15 @@ serveClient th u r q = bracket setup cleanup go
|
|||
}
|
||||
v <- liftIO $ runNetProto conn $ serveAuth u
|
||||
case v of
|
||||
Just (Just theiruuid) -> void $
|
||||
Right (Just theiruuid) -> void $
|
||||
runFullProto (Serving theiruuid) conn $
|
||||
serveAuthed u
|
||||
_ -> return ()
|
||||
Right Nothing -> do
|
||||
liftIO $ debugM "remotedaemon" "TOR connection failed to authenticate"
|
||||
return ()
|
||||
Left e -> do
|
||||
warning e
|
||||
return ()
|
||||
-- Merge the duplicated state back in.
|
||||
liftAnnex th $ mergeState st'
|
||||
debugM "remotedaemon" "done with TOR connection"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue