summaryrefslogtreecommitdiff
path: root/src/transports/ssh.c
diff options
context:
space:
mode:
authorEtienne Samson <tiennou7@gmail.com>2013-07-10 10:29:09 +0200
committerEtienne Samson <tiennou7@gmail.com>2013-07-10 09:33:14 +0200
commit367c1903e9aefd07de0d5be98c56640d13e3420d (patch)
tree984c2d814ca7114f5bb715d7d89bc3b3f68c5c32 /src/transports/ssh.c
parentf6bd0863352f70905b3068284f8ccd6beaa9a590 (diff)
downloadlibgit2-367c1903e9aefd07de0d5be98c56640d13e3420d.tar.gz
Add some missing error messages.
Diffstat (limited to 'src/transports/ssh.c')
-rw-r--r--src/transports/ssh.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index f2480b2cd..bb3843886 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -353,24 +353,31 @@ static int _git_ssh_setup_conn(
t->owner->cred_acquire_payload) < 0)
goto on_error;
} else {
- goto on_error;
- }
+ giterr_set(GITERR_NET, "Cannot set up SSH connection without credentials");
+ goto on_error;
+ }
assert(t->cred);
if (!user) {
user = git__strdup(default_user);
}
- if (_git_ssh_session_create(&session, s->socket) < 0)
+ if (_git_ssh_session_create(&session, s->socket) < 0) {
+ giterr_set(GITERR_NET, "Failed to initialize SSH session");
goto on_error;
-
- if (_git_ssh_authenticate_session(session, user, t->cred) < 0)
+ }
+
+ if (_git_ssh_authenticate_session(session, user, t->cred) < 0) {
+ giterr_set(GITERR_NET, "Failed to authenticate SSH session");
goto on_error;
-
+ }
+
channel = libssh2_channel_open_session(session);
- if (!channel)
- goto on_error;
-
+ if (!channel) {
+ giterr_set(GITERR_NET, "Failed to open SSH channel");
+ goto on_error;
+ }
+
libssh2_channel_set_blocking(channel, 1);
s->session = session;