application controller: clean up exception handling.

* Simplify code.
* Show backtraces for all users, not just builders.
* Show backtraces only for unexpected server errors (status 5xx), not
  for normal client errors (status 4xx).
* Log expected errors at info level (reduce noise in production logs).
This commit is contained in:
evazion
2019-08-13 21:30:20 -05:00
parent 84d311f366
commit e70cae457d
7 changed files with 32 additions and 40 deletions

View File

@@ -1,6 +1,10 @@
<%# backtrace %>
<ul class="backtrace">
<% if exception.present? %>
<li><%= exception.class.to_s %> exception raised</li>
<% end %>
<% Rails.backtrace_cleaner.clean(backtrace).each do |b| %>
<li class="backtrace-line"><%= b %></li>
<% end %>