Sha256: 93441ba294f56b49941196d124829b558c52aa0a87b81bd5f62cff26e711b6d5

Contents?: true

Size: 817 Bytes

Versions: 16

Compression:

Stored size: 817 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

    # Returns [JobException] built from the supplied exception
    def self.from_exception(exc, **args)
      new(
        args.merge(
          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-6.0.0 lib/rocket_job/job_exception.rb
rocketjob-6.0.0.rc3 lib/rocket_job/job_exception.rb
rocketjob-6.0.0.rc2 lib/rocket_job/job_exception.rb
rocketjob-6.0.0.rc1 lib/rocket_job/job_exception.rb
rocketjob-5.4.1 lib/rocket_job/job_exception.rb
rocketjob-5.4.0 lib/rocket_job/job_exception.rb
rocketjob-5.4.0.beta2 lib/rocket_job/job_exception.rb
rocketjob-5.4.0.beta1 lib/rocket_job/job_exception.rb
rocketjob-5.3.3 lib/rocket_job/job_exception.rb
rocketjob-5.3.2 lib/rocket_job/job_exception.rb
rocketjob-5.3.1 lib/rocket_job/job_exception.rb
rocketjob-5.3.0 lib/rocket_job/job_exception.rb
rocketjob-5.2.0 lib/rocket_job/job_exception.rb
rocketjob-5.2.0.beta3 lib/rocket_job/job_exception.rb
rocketjob-5.2.0.beta2 lib/rocket_job/job_exception.rb
rocketjob-5.2.0.beta1 lib/rocket_job/job_exception.rb