Fixes #5369 the FilterTable::ExceptionCatcher error and now shows exact exception message

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2021-03-24 15:00:16 +05:30
parent 0a62a6ac3b
commit 9af59c2164
2 changed files with 5 additions and 2 deletions

View file

@ -41,9 +41,13 @@ module FilterTable
end
def to_s
@original_resource.to_s
"#{@original_resource.to_s} (#{@original_exception.message})"
end
alias inspect to_s
def to_ary
[ to_s ]
end
end
class Trace

View file

@ -127,7 +127,6 @@ describe "filtertable functional tests" do
describe "if control fails" do
it "should show the exact error message" do
controls = ["exception_catcher_test"]
cmd = "exec " + ft_profile_path + " --controls " + controls.join(" ") + " --no-sudo"
run_result = run_result_for_controls(controls)
outcome_hash = failed_control_test_outcomes(run_result)
_(outcome_hash["exception_catcher_test"]).must_include "`tags` for resource is missing"