Commit 02c7da2e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #26 from regru/do_not_fall_on_deploy_keys

Do not fall on discover deployment keys. Closes #25
parents 30185044 6ec6fa78
......@@ -22,7 +22,7 @@ class GitlabNet
def discover(key)
key_id = key.gsub("key-", "")
resp = get("#{host}/discover?key_id=#{key_id}")
JSON.parse(resp.body)
JSON.parse(resp.body) rescue nil
end
def check
......
......@@ -26,7 +26,7 @@ class GitlabShell
end
else
user = api.discover(@key_id)
puts "Welcome to GitLab, #{user['name']}!"
puts "Welcome to GitLab, #{user && user['name'] || 'Anonymous'}!"
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