Module: Legion::Extensions::Helpers::Logger

Includes:
Base, Logging::Helper
Included in:
Data, Lex, Task, Transport
Defined in:
lib/legion/extensions/helpers/logger.rb

Constant Summary

Constants included from Base

Base::NAMESPACE_BOUNDARIES

Instance Method Summary collapse

Methods included from Base

#actor_class, #actor_const, #actor_name, #amqp_prefix, #calling_class, #calling_class_array, #from_json, #full_path, #lex_class, #lex_const, #lex_name, #lex_slug, #log_tag, #normalize, #runner_class, #runner_const, #runner_name, #segments, #settings_path, #table_prefix, #to_dotted_hash

Instance Method Details

#handle_runner_exception(exception, task_id: nil, **opts) ⇒ Object

rubocop:disable Style/ArgumentsForwarding

Raises:

  • (Legion::Exception::HandledTask)


12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/legion/extensions/helpers/logger.rb', line 12

def handle_runner_exception(exception, task_id: nil, **opts) # rubocop:disable Style/ArgumentsForwarding
  handle_exception(exception, task_id: task_id, **opts) # rubocop:disable Style/ArgumentsForwarding

  unless task_id.nil?
    Legion::Transport::Messages::TaskLog.new(
      task_id:      task_id,
      runner_class: to_s,
      entry:        { exception: true, message: exception.message, **opts }
    ).publish
  end

  raise Legion::Exception::HandledTask
end