module ActiveWorker::Behavior::CreateFromError

Public Class Methods

extended(base) click to toggle source
# File lib/active_worker/behavior/create_from_error.rb, line 5
def self.extended(base)
  base.field :stack_trace
  base.field :error_type
end

Public Instance Methods

create_error_from_configuration(configuration, error) click to toggle source
# File lib/active_worker/behavior/create_from_error.rb, line 10
def create_error_from_configuration(configuration, error)
  constructor_options = {
      :message => "#{configuration.event_name} FAILED: #{error.message}",
      :stack_trace => error.backtrace.join("\n"),
      :configuration => configuration,
      :error_type => error.class.name
  }
  create! constructor_options
end