Class: ActiveBatch::WorkUnit

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
WithActiveJobArguments
Defined in:
app/models/active_batch/work_unit.rb

Instance Method Summary collapse

Methods included from WithActiveJobArguments

#arguments, #arguments=

Instance Method Details

#error(exception) ⇒ Object



11
12
13
14
15
16
# File 'app/models/active_batch/work_unit.rb', line 11

def error(exception)
  self.update!(
      status: :failed,
      work_result: "#{exception.message}\n#{exception.backtrace.join("\n")}"
  )
end