%start = params[:start].to_i %>
<%failed = Resque::Failure.all(start, 20)%>
<% index = 0 %>
Failed Jobs
<%unless failed.empty?%>
<%end%>
Showing <%=start%> to <%= start + 20 %> of <%= size = Resque::Failure.count %> jobs
<%for job in failed%>
<% index += 1 %>
-
<% if job.nil? %>
- Error
- Job <%= index%> could not be parsed; perhaps it contains invalid JSON?
<% else %>
- Worker
-
<%= job['worker'].split(':')[0...2].join(':') %> on <%= job['queue'] %> at <%= Time.parse(job['failed_at']).strftime("%D %T %z") %>
<% if job['retried_at'] %>
<% else %>
<% end %>
- Class
<%= job['payload'] ? job['payload']['class'] : 'nil' %>
- Arguments
<%=h job['payload'] ? show_args(job['payload']['args']) : 'nil' %>
- Exception
<%= job['exception'] %>
- Error
-
<% if job['backtrace'] %>
<%= h(job['error']) %>
<%=h job['backtrace'].join("\n") %>
<% else %>
<%=h job['error'] %>
<% end %>
<% end %>
<%end%>
<%= partial :next_more, :start => start, :size => size %>