mirego/gaffe

View on GitHub
app/views/layouts/error.html.erb

Summary

Maintainability
Test Coverage
<!doctype html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Error!</title>
    <style type="text/css">
      <%= File.read(Gaffe.root.join('app/assets/stylesheets/errors.css')).gsub("\n", ' ').gsub('  ', ' ') %>
    </style>
  </head>
  <body>
    <div id="wrap">
      <h1>Error!</h1>
      <p>This is an error page brought to you by <a href="https://github.com/mirego/gaffe">Gaffe</a>.</p>

      <div class="content">
        <hr>
        <%= yield %>
        <hr>
      </div>

      <% if Rails.env.development? || Rails.env.test? %>
        <p>Original exception (only displayed in <strong>development</strong> and <strong>test</strong> environment):</p>

<pre>
<code><%= @exception.inspect %></code>
</pre>
      <% end %>

      <p>You can overwrite this page by creating these files:</p>

<% handlers = ActionView::Template::Handlers.extensions.map(&:to_s).join(', ') %>
<pre>
<code><%= Rails.root.join('app', 'views', 'layouts', "error.html.<em title='#{handlers}'>handler</em>").to_s.html_safe %></code>
<code><%= Rails.root.join('app', 'views', 'errors', "#{@rescue_response.to_s}.html.<em title='#{handlers}'>handler</em>").to_s.html_safe %></code>
</pre>
    </div>
  </body>
</html>