Commit 6ec6fa78 authored by Akzhan's avatar Akzhan

Do not fall on discover deployment keys. Closes #25

parent f0eb8017
......@@ -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