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

error-handling: remote, transport

parent d4d648b0
...@@ -131,7 +131,8 @@ typedef enum { ...@@ -131,7 +131,8 @@ typedef enum {
GITERR_REGEX, GITERR_REGEX,
GITERR_ODB, GITERR_ODB,
GITERR_INDEX, GITERR_INDEX,
GITERR_OBJECT GITERR_OBJECT,
GITERR_NET,
} git_error_class; } git_error_class;
/** /**
......
...@@ -46,7 +46,8 @@ static git_transport_cb transport_find_fn(const char *url) ...@@ -46,7 +46,8 @@ static git_transport_cb transport_find_fn(const char *url)
int git_transport_dummy(git_transport **transport) int git_transport_dummy(git_transport **transport)
{ {
GIT_UNUSED(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) int git_transport_new(git_transport **out, const char *url)
...@@ -66,11 +67,10 @@ 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); error = fn(&transport);
if (error < GIT_SUCCESS) if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to create new transport"); return error;
transport->url = git__strdup(url); transport->url = git__strdup(url);
if (transport->url == NULL) GITERR_CHECK_ALLOC(transport->url);
return GIT_ENOMEM;
*out = transport; *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