summaryrefslogtreecommitdiff
path: root/src/transport.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-03-06 08:12:35 +0100
committerVicent Martí <tanoku@gmail.com>2012-04-11 19:16:10 +0200
commit4376f7f6f4a46ecbcc0136948b68782956cd3c45 (patch)
tree5602f22c16706e591efa7585f369bf8b433f5496 /src/transport.c
parentd4d648b042b726a03611063212069adb061e863e (diff)
downloadlibgit2-4376f7f6f4a46ecbcc0136948b68782956cd3c45.tar.gz
error-handling: remote, transport
Diffstat (limited to 'src/transport.c')
-rw-r--r--src/transport.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/transport.c b/src/transport.c
index 785ddc35d..8087b2e44 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -46,7 +46,8 @@ static git_transport_cb transport_find_fn(const char *url)
int git_transport_dummy(git_transport **transport)
{
GIT_UNUSED(transport);
- return git__throw(GIT_ENOTIMPLEMENTED, "This protocol isn't implemented. Sorry");
+ giterr_set(GITERR_NET, "This transport isn't implemented. Sorry");
+ return -1;
}
int git_transport_new(git_transport **out, const char *url)
@@ -66,11 +67,10 @@ int git_transport_new(git_transport **out, const char *url)
error = fn(&transport);
if (error < GIT_SUCCESS)
- return git__rethrow(error, "Failed to create new transport");
+ return error;
transport->url = git__strdup(url);
- if (transport->url == NULL)
- return GIT_ENOMEM;
+ GITERR_CHECK_ALLOC(transport->url);
*out = transport;