Exception: Chef::Exceptions::MissingRole

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/chef/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_or_expansion = NOT_PASSED) ⇒ MissingRole

Returns a new instance of MissingRole.


274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/chef/exceptions.rb', line 274

def initialize(message_or_expansion = NOT_PASSED)
  @expansion = nil
  case message_or_expansion
  when NOT_PASSED
    super()
  when String
    super
  when RunList::RunListExpansion
    @expansion = message_or_expansion
    missing_roles = @expansion.errors.join(", ")
    super("The expanded run list includes nonexistent roles: #{missing_roles}")
  end
end

Instance Attribute Details

#expansionObject (readonly)

Returns the value of attribute expansion


272
273
274
# File 'lib/chef/exceptions.rb', line 272

def expansion
  @expansion
end