Module: ChefDK::NestedExceptionWithInspector

Included in:
ChefRunnerError, PolicyfileNestedException
Defined in:
lib/chef-dk/service_exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause.



29
30
31
# File 'lib/chef-dk/service_exceptions.rb', line 29

def cause
  @cause
end

#inspectorObject (readonly)

Returns the value of attribute inspector.



30
31
32
# File 'lib/chef-dk/service_exceptions.rb', line 30

def inspector
  @inspector
end

Instance Method Details

#extended_error_infoObject



42
43
44
# File 'lib/chef-dk/service_exceptions.rb', line 42

def extended_error_info
  inspector.extended_error_info
end

#initialize(message, cause) ⇒ Object



32
33
34
35
36
# File 'lib/chef-dk/service_exceptions.rb', line 32

def initialize(message, cause)
  super(message)
  @inspector = inspector_for(cause)
  @cause = cause
end

#reasonObject



38
39
40
# File 'lib/chef-dk/service_exceptions.rb', line 38

def reason
  "(#{cause.class.name}) #{inspector.message}"
end