<% if @cleaned_data[:first_seen_at] %>

This exception occurred <%= @cleaned_data[:occurrences] %> times since <%= @cleaned_data[:first_seen_at] %>.

<% end %> Error #: <%= @cleaned_data[:timestamp] -%>
Server: <%= @cleaned_data[:server].presence || 'hostname not set'.html_safe -%>
<% if @cleaned_data[:scm_revision] %> Revision: <%= @cleaned_data[:scm_revision] %>
<% end %> URL:
<% if (request = @cleaned_data[:request]) %> <%= request[:url] || 'no URL in request data'.html_safe %>
Referred from: <%= @cleaned_data[:environment]['HTTP_REFERER'] || 'no referrer'.html_safe -%>
<% else %> no URL accessed <% end %>

<% if @cleaned_data[:notes] %> Exception Notes: (from config/exception.yml)
<%= @cleaned_data[:notes].gsub("\n","
\n").gsub(/ {2,}/) { |spaces| ' '*spaces.size }.html_safe %>

<% end %> User summary:
<% if (user_details = @cleaned_data[:user_details]) && ( user_details[:user] || user_details[:organization] ) %> User: <%= user_details[:user] %> (<%= user_details[:username] %>)
Organization: <%= h(user_details[:organization]).gsub("\n","
\n").gsub(/ {2,}/) { |spaces| ' '*spaces.size }.html_safe %>
<% if user_details[:impersonated_organization] %>
Impersonating:
Organization: <%= user_details[:impersonated_organization] %> <% end %> <% else %> No user logged in. <% end %>


Exception:

<%= h(@cleaned_data[:error]).gsub("\n","
\n").gsub(/ {2,}/) { |spaces| ' '*spaces.size }.html_safe %>

Where:

<% location = @cleaned_data[:location] %> <%= "#{ h location[:controller]}##{ h location[:action]}
".html_safe if location && location[:controller] -%> <%= "#{ h location[:file]}, line #{ h location[:line]}
".html_safe if location && location[:file] -%> <% for section in ExceptionHandling::SECTIONS %> <% section_value = @cleaned_data[section] %> <% if section_value %>

<%= section.to_s.capitalize -%>:

<%= case section_value
   when Hash
     section_value[:to_s]
   when Array
     section_value.join( "\n" )
   when NilClass # omitted
   else
        if section_value.respond_to?(:to_s)
          section_value.to_s
        else
          raise "Unexpected value #{section_value.inspect} for section #{section}"
        end
   end
-%>
<% end %> <% end %>