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.



426
427
428
429
# File 'lib/berkshelf/errors.rb', line 426

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

Instance Method Details

#to_sObject Also known as: message



431
432
433
434
435
# File 'lib/berkshelf/errors.rb', line 431

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