Skip to content

Commit

Permalink
show basic rails-specific data in stack traces. see #21
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Dec 11, 2012
1 parent ed4bf39 commit 851619e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/better_errors/error_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def backtrace_frames
end

private
def rack_session
env['rack.session']
end

def rails_params
env['action_dispatch.request.parameters']
end

def uri_prefix
env["SCRIPT_NAME"] || ""
end
Expand Down
14 changes: 14 additions & 0 deletions lib/better_errors/templates/variable_info.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
<div class="sub">
<h3>Request info</h3>
<div class='inset variables'>
<table class="var_table">
<% if rails_params %>
<tr><td class="name">Request parameters</td><td><pre><%== inspect_value rails_params %></pre></td></tr>
<% end %>
<% if rack_session %>
<tr><td class="name">Rack session</td><td><pre><%== inspect_value rack_session %></pre></td></tr>
<% end %>
</table>
</div>
</div>

<div class="sub">
<h3>Local Variables</h3>
<div class='inset variables'>
Expand Down

0 comments on commit 851619e

Please sign in to comment.