clean P2P protocol shutdown on EOF try 2

Same goal as b18fb1e343 but without
breaking backwards compatability. Just return IO exceptions when running
the P2P protocol, so that git-annex-shell can detect eof and avoid the
ugly message.

This commit was sponsored by Ethan Aubin.
This commit is contained in:
Joey Hess 2018-09-25 16:49:59 -04:00
parent 80defa62c6
commit 6134431254
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 70 additions and 45 deletions

View file

@ -324,4 +324,4 @@ setupLink remotename (P2PAddressAuth addr authtoken) = do
storeP2PRemoteAuthToken addr authtoken
return LinkSuccess
go (Right Nothing) = return $ AuthenticationError "Unable to authenticate with peer. Please check the address and try again."
go (Left e) = return $ AuthenticationError $ "Unable to authenticate with peer: " ++ e
go (Left e) = return $ AuthenticationError $ "Unable to authenticate with peer: " ++ describeProtoFailure e