Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 986

Show
Ignore:
Timestamp:
03/23/05 12:03:30 (4 years ago)
Author:
david
Message:

Tweaked the rescue with breakpoint, still not perfect

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/rescue.rb

    r638 r986  
    7878        begin 
    7979          perform_action_without_rescue 
    80         rescue => exception 
    81           if defined?(Breakpoint) and @params["BP-RETRY"] then 
     80        rescue Object => exception 
     81          if defined?(Breakpoint) && @params["BP-RETRY"] 
    8282            msg = exception.backtrace.first 
    8383            if md = /^(.+?):(\d+)(?::in `(.+)')?$/.match(msg) then 
  • trunk/actionpack/lib/action_controller/templates/rescues/_request_and_response.rhtml

    r984 r986  
    88<% if defined?(Breakpoint) %> 
    99  <br /><br /> 
    10   <% begin %><%= form_tag({:params => {}, :only_path => true}, "method" => @request.method) %> 
    11     <input type="hidden" name="BP-RETRY" value="1" /> 
     10  <% begin %> 
     11    <%= form_tag(@request.request_uri, "method" => @request.method) %> 
     12      <input type="hidden" name="BP-RETRY" value="1" /> 
    1213   
    13     <% for key, values in @params %> 
    14       <% next if key == "BP-RETRY" %> 
    15       <% for value in Array(values) %> 
    16         <input type="hidden" name="<%= key %>" value="<%= value %>" /> 
     14      <% for key, values in @params %> 
     15        <% next if key == "BP-RETRY" %> 
     16        <% for value in Array(values) %> 
     17          <input type="hidden" name="<%= key %>" value="<%= value %>" /> 
     18        <% end %> 
    1719      <% end %> 
    18     <% end %> 
    1920 
    20     <input type="submit" value="Retry with Breakpoint" /> 
    21   </form> 
     21      <input type="submit" value="Retry with Breakpoint" /> 
     22    </form> 
    2223  <% rescue Exception => e %> 
    2324    <%=h "Couldn't render breakpoint link due to #{e.class} #{e.message}" %>