diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-02-11 23:43:57 +0100 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-02-11 23:43:57 +0100 |
| commit | 562d7eb4ecaa9ca35f970567c0f09cdb29d26521 (patch) | |
| tree | 032eb81a84675799500b5ecb54789fea90f3fcb6 /bin | |
| parent | f92a9c5a5f3f1cfc8a827abcf67a508133f39f04 (diff) | |
| download | gitlab-shell-562d7eb4ecaa9ca35f970567c0f09cdb29d26521.tar.gz | |
Show nice error message when internal API is unreachable.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/check | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -8,13 +8,18 @@ require_relative '../lib/gitlab_net' # print "Check GitLab API access: " -resp = GitlabNet.new.check -if resp.code == "200" - print 'OK' -else - abort "FAILED. code: #{resp.code}" +begin + resp = GitlabNet.new.check + if resp.code == "200" + print 'OK' + else + abort "FAILED. code: #{resp.code}" + end +rescue GitlabNet::ApiUnreachableError + abort "FAILED: Failed to connect to internal API" end + puts "\nCheck directories and files: " config = GitlabConfig.new |
