require 'rack/showexceptions' module Sinatra class ShowExceptions < Rack::ShowExceptions def initialize(app) @app = app @template = ERB.new(TEMPLATE) end def frame_class(frame) if frame.filename =~ /lib\/sinatra.*\.rb/ "framework" elsif (defined?(Gem) && frame.filename.include?(Gem.dir)) || frame.filename =~ /\/bin\/(\w+)$/ "system" else "app" end end TEMPLATE = <
<%=h frames.first.filename.split("/").last %>
<%=h frames.first.function %>
<%=h frame.filename %>
in
<%=h frame.function %>
<%=h line %>
<%=
h frame.context_line %>
<%=h line %>
Variable | Value |
---|---|
<%=h key %> | <%=h val.inspect %> |
No GET data.
<% end %>Variable | Value |
---|---|
<%=h key %> | <%=h val.inspect %> |
No POST data.
<% end %>Variable | Value |
---|---|
<%=h key %> | <%=h val %> |
You're seeing this error because you have
enabled the show_exceptions
setting.