Permalink
Browse files

better error messages for upload_pack

  • Loading branch information...
mojombo committed Jul 6, 2008
1 parent f70cfc7 commit 2ff8cba9ada7fc1224b037056c54cb4e4e99b7ac
Showing with 3 additions and 0 deletions.
  1. +3 −0 elibs/upload_pack.erl
View
@@ -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.
@@ -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.
@@ -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.

0 comments on commit 2ff8cba

Please sign in to comment.