transport: provide clearer / unique error messages

Provide more user-friendly error messages in smart protocol negotiation
failures.
This commit is contained in:
Edward Thomson
2023-05-19 17:34:09 +01:00
parent 18474f7d69
commit bc124bb435

View File

@@ -59,7 +59,7 @@ int git_smart__store_refs(transport_smart *t, int flushes)
return recvd;
if (recvd == 0) {
git_error_set(GIT_ERROR_NET, "early EOF receiving refs");
git_error_set(GIT_ERROR_NET, "could not read refs from remote repository");
return GIT_EEOF;
}
@@ -285,7 +285,7 @@ static int recv_pkt(
if ((ret = git_smart__recv(t)) < 0) {
return ret;
} else if (ret == 0) {
git_error_set(GIT_ERROR_NET, "early EOF receiving packet");
git_error_set(GIT_ERROR_NET, "could not read from remote repository");
return GIT_EEOF;
}
} while (error);
@@ -940,7 +940,7 @@ static int parse_report(transport_smart *transport, git_push *push)
}
if (recvd == 0) {
git_error_set(GIT_ERROR_NET, "early EOF receiving report");
git_error_set(GIT_ERROR_NET, "could not read report from remote repository");
error = GIT_EEOF;
goto done;
}