Skip to content

Instantly share code, notes, and snippets.

@rubymerchant
Created August 10, 2009 09:19
Show Gist options
  • Save rubymerchant/165103 to your computer and use it in GitHub Desktop.
Save rubymerchant/165103 to your computer and use it in GitHub Desktop.
module Delayed
class Job < ActiveRecord::Base
def log_exception(error)
logger.error "* [JOB] #{name} failed with #{error.class.name}: #{error.message} - #{attempts} failed attempts"
logger.error(error)
subject = "[JOB] #{name} failed."
body = "* [JOB] #{name} failed with #{error.class.name}: #{error.message} - #{attempts} failed attempts"
UserMailer.deliver_delayed_job_error_notification(subject, body)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment