Class: ExceptionNotification::Resque

Inherits:
Resque::Failure::Base
  • Object
show all
Defined in:
lib/exception_notification/resque.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.countObject



7
8
9
# File 'lib/exception_notification/resque.rb', line 7

def self.count
  ::Resque::Stat[:failed]
end

Instance Method Details

#saveObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/exception_notification/resque.rb', line 11

def save
  data = {
    error_class: exception.class.name,
    error_message: exception.message,
    failed_at: Time.now.to_s,
    payload: payload,
    queue: queue,
    worker: worker.to_s
  }

  ExceptionNotifier.notify_exception(exception, data: {resque: data})
end