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)



229
230
231
# File 'lib/berkshelf/errors.rb', line 229

def initialize(shortname)
  @shortname = shortname
end

Instance Method Details

#to_sObject



233
234
235
236
237
238
239
# File 'lib/berkshelf/errors.rb', line 233

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