summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab_net.rb3
-rw-r--r--lib/gitlab_shell.rb1
-rw-r--r--spec/gitlab_shell_spec.rb5
3 files changed, 2 insertions, 7 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 6e76c98..e74c97f 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -101,7 +101,8 @@ class GitlabNet
begin
response = http.start { http.request(request) }
- rescue
+ rescue => e
+ $logger.warn "Failed to connect to internal API <#{method.to_s.upcase} #{url}>: #{e.inspect}"
raise ApiUnreachableError
end
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 9605136..6422fff 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -36,7 +36,6 @@ class GitlabShell
puts "Welcome to GitLab, #{username}!"
end
rescue GitlabNet::ApiUnreachableError => ex
- $logger.warn "gitlab-shell: Failed to connect to internal API"
puts "Failed to authorize your Git request: internal API unreachable"
rescue DisallowedCommandError => ex
message = "gitlab-shell: Attempt to execute disallowed command <#{@origin_cmd}> by #{log_username}."
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index 4ca7984..f3aba54 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -150,11 +150,6 @@ describe GitlabShell do
it "should not execute the command" do
subject.should_not_receive(:exec_cmd)
end
-
- it "should log the failed connection" do
- message = "gitlab-shell: Failed to connect to internal API"
- $logger.should_receive(:warn).with(message)
- end
end
end