diff options
author | ash <smashwilson@gmail.com> | 2013-05-18 20:02:28 +0000 |
---|---|---|
committer | ash <smashwilson@gmail.com> | 2013-05-18 20:02:28 +0000 |
commit | c2844b265038fb1b58e78c06fa80da805a8bc7ec (patch) | |
tree | 7e8e7c2a57c6a4d0a33f21e62410b4e4694b8e0f | |
parent | 90b9e113812fb566b0535e44df3f3279bf6c4438 (diff) | |
download | gitlab-shell-c2844b265038fb1b58e78c06fa80da805a8bc7ec.tar.gz |
Always log non-200 responses from the GitLab API.
-rw-r--r-- | lib/gitlab_net.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index ac1534e..c15de8e 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -56,7 +56,11 @@ class GitlabNet end http.start {|http| http.request(request) }.tap do |resp| - $logger.debug { "Received response #{resp.code} => #{resp.body}" } + if resp.code == "200" + $logger.debug { "Received response #{resp.code} => <#{resp.body}>." } + else + $logger.error { "API call <GET #{url}> failed: #{resp.code} => <#{resp.body}>." } + end end end end |