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

Changeset 4955

Show
Ignore:
Timestamp:
09/03/06 23:51:34 (2 years ago)
Author:
david
Message:

Changed that uncaught exceptions raised any where in the application will cause RAILS_ROOT/public/500.html to be read and shown instead of just the static "Application error (Rails)" [DHH]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r4954 r4955  
    11*SVN* 
     2 
     3* Changed that uncaught exceptions raised any where in the application will cause RAILS_ROOT/public/500.html to be read and shown instead of just the static "Application error (Rails)" [DHH] 
    24 
    35* Integration tests: thoroughly test ActionController::Integration::Session.  #6022 [Kevin Clark] 
  • trunk/actionpack/lib/action_controller/rescue.rb

    r4885 r4955  
    4949      def rescue_action_in_public(exception) #:doc: 
    5050        case exception 
    51           when RoutingError, UnknownAction then 
     51          when RoutingError, UnknownAction 
    5252            render_text(IO.read(File.join(RAILS_ROOT, 'public', '404.html')), "404 Not Found") 
    53           else render_text "<html><body><h1>Application error (Rails)</h1></body></html>" 
     53          else 
     54            render_text(IO.read(File.join(RAILS_ROOT, 'public', '500.html')), "500 Internal Error") 
    5455        end 
    5556      end 
     
    126127      def response_code_for_rescue(exception) 
    127128        case exception 
    128           when UnknownAction, RoutingError then "404 Page Not Found" 
    129           else "500 Internal Error" 
     129          when UnknownAction, RoutingError  
     130            "404 Page Not Found" 
     131          else 
     132            "500 Internal Error" 
    130133        end 
    131134      end