Skip to content

Commit

Permalink
better error messages for upload_pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Jul 6, 2008
1 parent f70cfc7 commit 2ff8cba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions elibs/upload_pack.erl
Expand Up @@ -33,6 +33,7 @@ convert_path(Sock, Host, Path) ->
repo_existence(Sock, Host, Path, FullPath);
{error, nomatch} ->
error_logger:info_msg("no repo match: ~p~n", [Path]),
gen_tcp:send(Sock, "003b\n*********'\n\nNo matching repositories found.\n\n*********"),
ok = gen_tcp:close(Sock)
end.

Expand All @@ -43,6 +44,7 @@ repo_existence(Sock, Host, Path, FullPath) ->
export_ok(Sock, Host, Path, FullPath);
false ->
error_logger:info_msg("no such repo: ~p~n", [FullPath]),
gen_tcp:send(Sock, "003b\n*********'\n\nNo matching repositories found.\n\n*********"),
ok = gen_tcp:close(Sock)
end.

Expand All @@ -54,6 +56,7 @@ export_ok(Sock, Host, Path, FullPath) ->
make_port(Sock, Host, Path, FullPath);
false ->
error_logger:info_msg("permission denied to repo: ~p~n", [FullPath]),
gen_tcp:send(Sock, "0048\n*********'\n\nPermission denied. Repository is not public.\n\n*********"),
ok = gen_tcp:close(Sock)
end.

Expand Down

0 comments on commit 2ff8cba

Please sign in to comment.