Skip to content

Commit

Permalink
Merge pull request #161 from chef/JM/redact_exception_message
Browse files Browse the repository at this point in the history
Redacting exception message
  • Loading branch information
marcparadise authored May 22, 2018
2 parents c58aa71 + e799a9b commit db042c6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/chef-run/lib/chef-run/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,11 @@ def converge(reporter, local_policy_path, target_host)

def handle_perform_error(e)
id = e.respond_to?(:id) ? e.id : e.class.to_s
message = e.respond_to?(:message) ? e.message : e.to_s
Telemeter.capture(:error, exception: { id: id, message: message })
# TODO: This is currently sending host information for certain ssh errors
# post release we need to scrub this data. For now I'm redacting the
# whole message.
# message = e.respond_to?(:message) ? e.message : e.to_s
Telemeter.capture(:error, exception: { id: id, message: "redacted" })
wrapper = ChefRun::StandardErrorResolver.wrap_exception(e)
capture_exception_backtrace(wrapper)
# Now that our housekeeping is done, allow user-facing handling/formatting
Expand Down

0 comments on commit db042c6

Please sign in to comment.