Sha256: 7705437f80c067c9700c75ac647107ade582797aaff0ae884bc4a583de72fce0

Contents?: true

Size: 869 Bytes

Versions: 16

Compression:

Stored size: 869 Bytes

Contents

module RocketJob
  class JobException
    include Plugins::Document

    embedded_in :job, inverse_of: :exception
    embedded_in :slice, inverse_of: :exception
    embedded_in :dirmon_entry, inverse_of: :exception

    # Name of the exception class
    field :class_name, type: String

    # Exception message
    field :message, type: String

    # Exception Backtrace [Array<String>]
    field :backtrace, type: Array, default: []

    # Name of the server on which this exception occurred
    field :worker_name, type: String

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

    # 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

16 entries across 16 versions & 1 rubygems

Version Path
rocketjob-3.4.3 lib/rocket_job/job_exception.rb
rocketjob-3.4.2 lib/rocket_job/job_exception.rb
rocketjob-3.4.1 lib/rocket_job/job_exception.rb
rocketjob-3.4.0 lib/rocket_job/job_exception.rb
rocketjob-3.3.4 lib/rocket_job/job_exception.rb
rocketjob-3.3.3 lib/rocket_job/job_exception.rb
rocketjob-3.3.2 lib/rocket_job/job_exception.rb
rocketjob-3.3.1 lib/rocket_job/job_exception.rb
rocketjob-3.3.0 lib/rocket_job/job_exception.rb
rocketjob-3.2.1 lib/rocket_job/job_exception.rb
rocketjob-3.2.0 lib/rocket_job/job_exception.rb
rocketjob-3.1.0 lib/rocket_job/job_exception.rb
rocketjob-3.0.5 lib/rocket_job/job_exception.rb
rocketjob-3.0.4 lib/rocket_job/job_exception.rb
rocketjob-3.0.3 lib/rocket_job/job_exception.rb
rocketjob-3.0.2 lib/rocket_job/job_exception.rb