Module: Actions::RemoteExecution::TemplateInvocationProgressLogging
- Included in:
- ProxyAction, RunHostJob
- Defined in:
- app/lib/actions/remote_execution/template_invocation_progress_logging.rb
Instance Method Summary collapse
- #log_template_invocation_exception(exception) ⇒ Object
- #template_invocation ⇒ Object
- #with_template_invocation_error_logging ⇒ Object
Instance Method Details
#log_template_invocation_exception(exception) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/lib/actions/remote_execution/template_invocation_progress_logging.rb', line 8 def log_template_invocation_exception(exception) id = 'exception-' + SecureRandom.hex(4) template_invocation.template_invocation_events.create!( :event_type => 'debug', :event => "#{exception.class}: #{exception.}", :timestamp => Time.zone.now, :external_id => id ) end |
#template_invocation ⇒ Object
4 5 6 |
# File 'app/lib/actions/remote_execution/template_invocation_progress_logging.rb', line 4 def template_invocation @template_invocation ||= TemplateInvocation.find_by(:run_host_job_task_id => task.id) end |
#with_template_invocation_error_logging ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'app/lib/actions/remote_execution/template_invocation_progress_logging.rb', line 18 def with_template_invocation_error_logging unless catch(::Dynflow::Action::ERROR) { yield || true } log_template_invocation_exception(error.exception) throw ::Dynflow::Action::ERROR end rescue => e # rubocop:disable Style/RescueStandardError log_template_invocation_exception(e) raise e end |