From 1b89df14f41860172ad7eb81f650c13998bfe6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Rzepecki?= Date: Mon, 21 Aug 2017 16:16:47 +0200 Subject: [PATCH] Show informative message when DATABASE_URL not set Check whether DATABASE_URL is set before trying to connect. If not set, fail fast with informative error instead of spinning for half a minute. --- bin/conjur-cli.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/conjur-cli.rb b/bin/conjur-cli.rb index 136391ba91..3a6351cfc1 100644 --- a/bin/conjur-cli.rb +++ b/bin/conjur-cli.rb @@ -11,6 +11,7 @@ def connect require 'sequel' def test_select + fail "DATABASE_URL not set" unless ENV['DATABASE_URL'] begin db = Sequel::Model.db = Sequel.connect(ENV['DATABASE_URL']) db['select 1'].first