From 2ff8cba9ada7fc1224b037056c54cb4e4e99b7ac Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Sun, 6 Jul 2008 15:26:14 -0700 Subject: [PATCH] better error messages for upload_pack --- elibs/upload_pack.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/elibs/upload_pack.erl b/elibs/upload_pack.erl index d350e1b..8be2098 100644 --- a/elibs/upload_pack.erl +++ b/elibs/upload_pack.erl @@ -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.