Skip to content

Commit

Permalink
Show informative message when DATABASE_URL not set
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dividedmind committed Sep 4, 2017
1 parent 2f73cf0 commit 1b89df1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/conjur-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b89df1

Please sign in to comment.