Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redacting exception message #161

Merged
merged 1 commit into from
May 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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