include error message when unable to connect to peer

This commit is contained in:
Joey Hess 2016-12-08 14:14:08 -04:00
parent b613ccf7a3
commit e56506d83c
No known key found for this signature in database
GPG key ID: C910D9222512E3C7

View file

@ -81,7 +81,7 @@ linkRemote remotename = do
setup (P2PAddressAuth addr authtoken) = do
g <- Annex.gitRepo
conn <- liftIO $ connectPeer g addr
`catchNonAsync` giveup "Unable to connect with peer. Please check that the peer is connected to the network, and try again."
`catchNonAsync` connerror
u <- getUUID
v <- liftIO $ runNetProto conn $ P2P.auth u authtoken
case v of
@ -96,3 +96,4 @@ linkRemote remotename = do
storeP2PRemoteAuthToken addr authtoken
return ok
_ -> giveup "Unable to authenticate with peer. Please check the address and try again."
connerror e = giveup $ "Unable to connect with peer. Please check that the peer is connected to the network, and try again. (" ++ show e ++ ")"