Files
danbooru/app/views/static/error.html.erb
evazion 0d69c03249 Fix "undefined method `is_builder?' for nil:NilClass" in static/error.html.erb.
`CurrentUser.user` may be nil if an exception is raised before it's
initialized.
2017-12-23 18:27:04 -06:00

14 lines
568 B
Plaintext

<% if CurrentUser.user.try(:is_builder?) && @exception.present? %>
<h1><%= @exception.class.to_s %> exception raised</h1>
<ul style="font-family: monospace; font-size: 1.2em; list-style-type: none;">
<li><%= @exception.message.dup.force_encoding("utf-8") %></li>
<%- Rails.backtrace_cleaner.clean(@exception.backtrace).each do |b| -%>
<li style="list-style-type: none;"><%= b %></li>
<%- end -%>
</ul>
<% elsif @error_message %>
<p><%= @error_message %></p>
<% else %>
<p><%= @exception.message.dup.force_encoding("utf-8") %></p>
<% end %>