summaryrefslogtreecommitdiff
path: root/lib/chef/action_collection.rb
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2020-07-31 17:16:37 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2020-07-31 17:16:37 +0530
commit94b8f2f535632592363bc4f64b5792265344f593 (patch)
tree0b3348b69aec186e8776fba264766ee3b9bbe976 /lib/chef/action_collection.rb
parenta0675c3219636a442c3d303cebfcd9e28ea2ebd9 (diff)
downloadchef-94b8f2f535632592363bc4f64b5792265344f593.tar.gz
Per resource error detail client run
- Add error_description to action_collection of resource based object. - Add error hash message class, message and detail to resource object. Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Diffstat (limited to 'lib/chef/action_collection.rb')
-rw-r--r--lib/chef/action_collection.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/action_collection.rb b/lib/chef/action_collection.rb
index efe03fff5f..1ac47630a9 100644
--- a/lib/chef/action_collection.rb
+++ b/lib/chef/action_collection.rb
@@ -44,6 +44,9 @@ class Chef
# @return [Exception] The exception that was thrown
attr_accessor :exception
+ # @return [Hash] JSON-formatted error description from the Chef::Formatters::ErrorMapper
+ attr_accessor :error_description
+
# @return [Numeric] The elapsed time in seconds with machine precision
attr_accessor :elapsed_time
@@ -223,6 +226,7 @@ class Chef
current_record.status = :failed
current_record.exception = exception
+ current_record.error_description = Formatters::ErrorMapper.resource_failed(new_resource, action, exception).for_json
end
# Hook called after an action is completed. This is always called, even if the action fails.