<% content_for :title, 'Internal Server Error' %>

<h1 class="error-code has-color-red-500">500</h1>
<h2 class="error-name has-color-red-400">server error</h2>

<p class="is-lead">
  <% if Rails.env.production? %>
    It's not your fault.
  <% else %>
    It's totally your fault. Fix it.
  <% end %>
</p>

<p>This error has been logged. We even look at them sometimes.</p>
<p>
  You can also report this
  <a href="https://meta.codidact.com/" target="_blank" rel="noopener noreferrer">on Meta</a>
  to help us keep track of what's going wrong &mdash; quote error ID <code><%= @log.uuid %></code>.
</p>

<p>
  <%= link_to 'Go back', :back, class: 'button is-outlined' %>
  <%= link_to 'Go home', root_path, class: 'button is-outlined' %>
</p>

<hr/>

<% if Rails.env.development? %>
  <h1 class="has-margin-bottom-0 has-margin-top-0">Hi! You seem like you know what you're doing.</h1>
  <p class="is-lead has-margin-top-0">Here's the full gory details you really didn't want.</p>

  <p class="raw-markdown has-font-size-larger has-font-weight-bold has-color-red-700">
    <code><%= @exception.class %>: <%= @exception.message %></code>
  </p>

  <pre class="error-trace raw-markdown"><%= @exception.backtrace.select { |l| l.include? Rails.root.to_s }.join("\n") %></pre>

  <% console %>
<% end %>
