Skip to content

Commit

Permalink
Tweaked the rescue with breakpoint, still not perfect
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@986 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 23, 2005
1 parent 373adc7 commit 3306813
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_controller/rescue.rb
Expand Up @@ -77,8 +77,8 @@ def rescue_action_locally(exception)
def perform_action_with_rescue #:nodoc:
begin
perform_action_without_rescue
rescue => exception
if defined?(Breakpoint) and @params["BP-RETRY"] then
rescue Object => exception
if defined?(Breakpoint) && @params["BP-RETRY"]
msg = exception.backtrace.first
if md = /^(.+?):(\d+)(?::in `(.+)')?$/.match(msg) then
origin_file, origin_line = md[1], md[2].to_i
Expand Down
Expand Up @@ -7,18 +7,19 @@
<% if defined?(Breakpoint) %>
<br /><br />
<% begin %><%= form_tag({:params => {}, :only_path => true}, "method" => @request.method) %>
<input type="hidden" name="BP-RETRY" value="1" />
<% begin %>
<%= form_tag(@request.request_uri, "method" => @request.method) %>
<input type="hidden" name="BP-RETRY" value="1" />

<% for key, values in @params %>
<% next if key == "BP-RETRY" %>
<% for value in Array(values) %>
<input type="hidden" name="<%= key %>" value="<%= value %>" />
<% for key, values in @params %>
<% next if key == "BP-RETRY" %>
<% for value in Array(values) %>
<input type="hidden" name="<%= key %>" value="<%= value %>" />
<% end %>
<% end %>
<% end %>

<input type="submit" value="Retry with Breakpoint" />
</form>
<input type="submit" value="Retry with Breakpoint" />
</form>
<% rescue Exception => e %>
<%=h "Couldn't render breakpoint link due to #{e.class} #{e.message}" %>
<% end %>
Expand Down

0 comments on commit 3306813

Please sign in to comment.