Commit 4376f7f6 by Carlos Martín Nieto Committed by Vicent Martí

error-handling: remote, transport

parent d4d648b0
......@@ -131,7 +131,8 @@ typedef enum {
GITERR_REGEX,
GITERR_ODB,
GITERR_INDEX,
GITERR_OBJECT
GITERR_OBJECT,
GITERR_NET,
} git_error_class;
/**
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment