diff options
Diffstat (limited to 'src/transport.c')
| -rw-r--r-- | src/transport.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/transport.c b/src/transport.c index 4910f2433..bc4248d5b 100644 --- a/src/transport.c +++ b/src/transport.c @@ -54,7 +54,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) @@ -65,16 +66,17 @@ int git_transport_new(git_transport **out, const char *url) fn = transport_find_fn(url); - if (fn == NULL) - return git__throw(GIT_EINVALIDARGS, "Unsupported URL or non-existent path"); + if (fn == NULL) { + giterr_set(GITERR_NET, "Unsupported URL protocol"); + return -1; + } 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; |
