Sha256: 3304875bf3c744e5775fe98124ae786837de3119b8935ed44e8a45fc299e99db

Contents?: true

Size: 882 Bytes

Versions: 11

Compression:

Stored size: 882 Bytes

Contents

# encoding: UTF-8
module RocketJob
  # Heartbeat
  #
  # Information from the worker as at it's last heartbeat
  class JobException
    include MongoMapper::EmbeddedDocument

    # @formatter:off
    # Name of the exception class
    key :class_name,              String

    # Exception message
    key :message,                 String

    # Exception Backtrace [Array<String>]
    key :backtrace,               Array

    # Name of the worker on which this exception occurred
    key :worker_name,             String

    # The record within which this exception occurred
    key :record_number,           Integer

    # @formatter:on

    # Returns [JobException] built from the supplied exception
    def self.from_exception(exc)
      new(
        class_name: exc.class.name,
        message:    exc.message,
        backtrace:  exc.backtrace || []
      )
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rocketjob-2.1.3 lib/rocket_job/job_exception.rb
rocketjob-2.1.2 lib/rocket_job/job_exception.rb
rocketjob-2.1.1 lib/rocket_job/job_exception.rb
rocketjob-2.0.0 lib/rocket_job/job_exception.rb
rocketjob-2.0.0.rc3 lib/rocket_job/job_exception.rb
rocketjob-2.0.0.rc2 lib/rocket_job/job_exception.rb
rocketjob-2.0.0.rc1 lib/rocket_job/job_exception.rb
rocketjob-1.3.0 lib/rocket_job/job_exception.rb
rocketjob-1.2.1 lib/rocket_job/job_exception.rb
rocketjob-1.2.0 lib/rocket_job/job_exception.rb
rocketjob-1.1.3 lib/rocket_job/job_exception.rb