Exception: Chef::Exceptions::MissingRole

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

Constant Summary collapse

NULL =
Object.new

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_or_expansion = NULL) ⇒ MissingRole

Returns a new instance of MissingRole.



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/chef/exceptions.rb', line 151

def initialize(message_or_expansion=NULL)
  @expansion = nil
  case message_or_expansion
  when NULL
    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.



149
150
151
# File 'lib/chef/exceptions.rb', line 149

def expansion
  @expansion
end