Exception: Berkshelf::InvalidSourceURI

Inherits:
BerkshelfError show all
Defined in:
lib/berkshelf/errors.rb

Instance Method Summary collapse

Methods inherited from BerkshelfError

set_status_code

Constructor Details

#initialize(url, reason = nil) ⇒ InvalidSourceURI

Returns a new instance of InvalidSourceURI.



424
425
426
427
# File 'lib/berkshelf/errors.rb', line 424

def initialize(url, reason = nil)
  @url    = url
  @reason = reason
end

Instance Method Details

#to_sObject Also known as: message



429
430
431
432
433
# File 'lib/berkshelf/errors.rb', line 429

def to_s
  msg =  "'#{@url}' is not a valid Berkshelf source URI."
  msg << " #{@reason}." unless @reason.nil?
  msg
end