lib/rocket_job/job_exception.rb in rocketjob-2.1.3 vs lib/rocket_job/job_exception.rb in rocketjob-3.0.0.alpha
- old
+ new
@@ -1,29 +1,27 @@
# encoding: UTF-8
module RocketJob
- # Heartbeat
- #
- # Information from the worker as at it's last heartbeat
class JobException
- include MongoMapper::EmbeddedDocument
+ include Plugins::Document
- # @formatter:off
+ embedded_in :job, inverse_of: :exception
+ embedded_in :slice, inverse_of: :exception
+ embedded_in :dirmon_entry, inverse_of: :exception
+
# Name of the exception class
- key :class_name, String
+ field :class_name, type: String
# Exception message
- key :message, String
+ field :message, type: String
# Exception Backtrace [Array<String>]
- key :backtrace, Array
+ field :backtrace, type: Array, default: []
- # Name of the worker on which this exception occurred
- key :worker_name, String
+ # Name of the server on which this exception occurred
+ field :worker_name, type: String
# The record within which this exception occurred
- key :record_number, Integer
-
- # @formatter:on
+ field :record_number, type: Integer
# Returns [JobException] built from the supplied exception
def self.from_exception(exc)
new(
class_name: exc.class.name,