mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
Check if url is nil before making connection
This commit is contained in:
parent
201f59c376
commit
832169a066
1 changed files with 5 additions and 0 deletions
|
|
@ -2,6 +2,11 @@ require 'faraday'
|
||||||
|
|
||||||
class Http
|
class Http
|
||||||
def self.get_conn(verbose, url)
|
def self.get_conn(verbose, url)
|
||||||
|
if url.nil?
|
||||||
|
STDERR.puts "The url you provided was empty"
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
conn = Faraday.new(:url => url) do |faraday|
|
conn = Faraday.new(:url => url) do |faraday|
|
||||||
faraday.request :url_encoded
|
faraday.request :url_encoded
|
||||||
faraday.response :logger if verbose
|
faraday.response :logger if verbose
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue