Class: RocketJob::JobException

Inherits:
Object
  • Object
show all
Includes:
Plugins::Document
Defined in:
lib/rocket_job/job_exception.rb

Class Method Summary collapse

Class Method Details

.from_exception(exc, **args) ⇒ Object

Returns [JobException] built from the supplied exception



22
23
24
25
26
27
28
29
30
# File 'lib/rocket_job/job_exception.rb', line 22

def self.from_exception(exc, **args)
  new(
    args.merge(
      class_name: exc.class.name,
      message:    exc.message.to_s.encode("UTF-8", replace: ""),
      backtrace:  exc.backtrace || []
    )
  )
end