Sha256: 3ea068d22384149ca85ee5a3dfd3a887a25beef8395bcbb06cc6bb3c879db331

Contents?: true

Size: 849 Bytes

Versions: 3

Compression:

Stored size: 849 Bytes

Contents

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

    # 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

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

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rocketjob-1.0.0 lib/rocket_job/job_exception.rb
rocketjob-0.9.1 lib/rocket_job/job_exception.rb
rocketjob-0.9.0 lib/rocket_job/job_exception.rb