Exception: Berkshelf::InvalidSiteShortnameError

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

Instance Method Summary collapse

Methods inherited from BerkshelfError

status_code

Constructor Details

#initialize(shortname) ⇒ InvalidSiteShortnameError

Returns a new instance of InvalidSiteShortnameError.

Parameters:

  • shortname (String, Symbol)

    the shortname for the site (see SiteLocation::SHORTNAMES)



248
249
250
# File 'lib/berkshelf/errors.rb', line 248

def initialize(shortname)
  @shortname = shortname
end

Instance Method Details

#to_sObject



252
253
254
255
256
257
258
# File 'lib/berkshelf/errors.rb', line 252

def to_s
  [
    "Unknown site shortname '#{@shortname}' - supported shortnames are:",
    "",
    "  * " + SiteLocation::SHORTNAMES.keys.join("\n  * "),
  ].join("\n")
end