diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-20 10:51:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-20 10:51:10 +0000 |
commit | 98349f37a31979b04f01d8be59d0db83620abf24 (patch) | |
tree | e641b267c9dd447d33558f5bccf668d9e29719b2 /actionpack | |
parent | 6a7fc51c6675786f4791c45edc1fac42ea6e3df9 (diff) | |
download | rails-98349f37a31979b04f01d8be59d0db83620abf24.tar.gz rails-98349f37a31979b04f01d8be59d0db83620abf24.tar.bz2 rails-98349f37a31979b04f01d8be59d0db83620abf24.zip |
Gives Rescues some Love #680
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@709 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
3 files changed, 13 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/dependencies.rb b/actionpack/lib/action_controller/dependencies.rb index abf6ca7417..be32417894 100644 --- a/actionpack/lib/action_controller/dependencies.rb +++ b/actionpack/lib/action_controller/dependencies.rb @@ -70,6 +70,9 @@ module ActionController #:nodoc: require_dependency(dependency.to_s) rescue LoadError raise LoadError, "Missing #{layer} #{dependency}.rb" + rescue Object => exception + exception.blame_file! "=> #{layer} #{dependency}.rb" + raise end end end diff --git a/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml b/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml index aaeebba6f4..d807c4fb79 100644 --- a/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml @@ -1,6 +1,11 @@ +<% unless @exception.blamed_files.empty? %> + <a href="#" onclick="document.getElementById('blame_trace').style.display='block'; return false;">Show blamed files</a> + <pre id="blame_trace" style="display:none"><code><%=h @exception.describe_blame %></code></pre> +<% end %> + <% if defined?(Breakpoint) %> <br /><br /> - <%= form_tag({:params => {}, :only_path => true}, "method" => @request.method) %> + <% begin %><%= form_tag({:params => {}, :only_path => true}, "method" => @request.method) %> <input type="hidden" name="BP-RETRY" value="1" /> <% for key, values in @params %> @@ -12,6 +17,9 @@ <input type="submit" value="Retry with Breakpoint" /> </form> + <% rescue Exception => e %> + <%=h "Couldn't render breakpoint link due to #{e.class} #{e.message}" %> + <% end %> <% end %> <% diff --git a/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml b/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml index c9ea00ef8f..9fb2de5b10 100644 --- a/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml +++ b/actionpack/lib/action_controller/templates/rescues/diagnostics.rhtml @@ -6,7 +6,7 @@ <h1> <%=h @exception.class.to_s %> in - <%=h @request.parameters["controller"].capitalize %>#<%=h @request.parameters["action"] %> + <%=h (@request.parameters["controller"] || "<controller not set>").capitalize %>#<%=h @request.parameters["action"] || "<action not set>" %> </h1> <p><%=h Object.const_defined?(:RAILS_ROOT) ? @exception.message.gsub(RAILS_ROOT, "") : @exception.message %></p> |