summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index fad06d6..4c938b1 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -73,7 +73,14 @@ class GitlabNet
url = "#{host}/merge_request_urls?project=#{URI.escape(repo_path)}&changes=#{URI.escape(changes)}"
url += "&gl_repository=#{URI.escape(gl_repository)}" if gl_repository
resp = get(url)
- JSON.parse(resp.body) rescue []
+
+ if resp.code == '200'
+ JSON.parse(resp.body)
+ else
+ []
+ end
+ rescue
+ []
end
def check