Commit f61186ba authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'log-api-error' into 'master'

Log full Net::HTTP error.

See merge request !56
parents 63e16172 ddb0a8d1
......@@ -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
......
......@@ -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}."
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment