summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2015-05-21 11:43:31 -0700
committerBryan McLellan <btm@loftninjas.org>2015-05-27 14:16:31 -0400
commitce7e7c1a7d1538ffd3e14e6777424ec538a860c4 (patch)
treee540e7d8c6692e95e6ec2e781d0ec8c9727b898e /lib
parent44fb5b0f1987a0c6285a7a1f0b6b4d4b2d455ae0 (diff)
downloadchef-ce7e7c1a7d1538ffd3e14e6777424ec538a860c4.tar.gz
Give captured exception a meaningful name
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/audit/audit_reporter.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/audit/audit_reporter.rb b/lib/chef/audit/audit_reporter.rb
index fd3d13dd89..b74bf07b8b 100644
--- a/lib/chef/audit/audit_reporter.rb
+++ b/lib/chef/audit/audit_reporter.rb
@@ -34,7 +34,7 @@ class Chef
@rest_client = rest_client
# Ruby 1.9.3 and above "enumerate their values in the order that the corresponding keys were inserted."
@ordered_control_groups = Hash.new
- @exception = nil
+ @audit_phase_error = nil
end
def run_context
@@ -60,7 +60,7 @@ class Chef
# known control groups.
def audit_phase_failed(error)
# The stacktrace information has already been logged elsewhere
- @exception = error
+ @audit_phase_error = error
Chef::Log.debug("Audit Reporter failed.")
ordered_control_groups.each do |name, control_group|
audit_data.add_control_group(control_group)
@@ -120,9 +120,9 @@ class Chef
Chef::Log.debug("Sending audit report (run-id: #{audit_data.run_id})")
run_data = audit_data.to_hash
- if @exception
- error_info = "#{@exception.class}: #{@exception.message}"
- error_info << "\n#{@exception.backtrace.join("\n")}" if @exception.backtrace
+ if @audit_phase_error
+ error_info = "#{@audit_phase_error.class}: #{@audit_phase_error.message}"
+ error_info << "\n#{@audit_phase_error.backtrace.join("\n")}" if @audit_phase_error.backtrace
run_data[:error] = error_info
end