summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-11 23:43:57 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-11 23:43:57 +0100
commit562d7eb4ecaa9ca35f970567c0f09cdb29d26521 (patch)
tree032eb81a84675799500b5ecb54789fea90f3fcb6 /bin
parentf92a9c5a5f3f1cfc8a827abcf67a508133f39f04 (diff)
downloadgitlab-shell-562d7eb4ecaa9ca35f970567c0f09cdb29d26521.tar.gz
Show nice error message when internal API is unreachable.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check15
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/check b/bin/check
index f4588a2..b90e15d 100755
--- a/bin/check
+++ b/bin/check
@@ -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