Class: RedAlert::Sidekiq::Notifier

Inherits:
Object
  • Object
show all
Includes:
Notifier
Defined in:
lib/red_alert/sidekiq/notifier.rb

Instance Method Summary collapse

Methods included from Notifier

#alert, #filter_keys, included, #notifier_settings

Instance Method Details

#templateObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/red_alert/sidekiq/notifier.rb', line 6

def template
<<-EMAIL
A <%= exception.class %> occured: <%= exception %>

===================================================================
Message:
===================================================================

<%= data[:message].to_a.
  sort{|a,b| a.first <=> b.first}.
  map{ |k,v| "%-25s%p" % [k+':', v] }.
  join("\n  ") %>

===================================================================
Sidekiq Environment:
===================================================================

  PID:                     <%= $$ %>
  PWD:                     <%= Dir.getwd %>

  Worker Class:            <%= data[:worker_class] %>
  Queue:                   <%= data[:queue] %>

<% if exception.respond_to?(:backtrace) %>
===================================================================
Backtrace:
===================================================================

  <%= exception.backtrace.join("\n  ") %>
<% end %>
EMAIL
end