Greg Hauptmann
2007-May-24 20:24 UTC
Re: Custom 500 error handler still displaying default error text
Adam/All, Did you work this out / know how to fix this? I''m seeing the same thing here (i.e. want to stop that text at the top of the page coming in, it''s as if it''s part of the HTTP 500 error message process that perhaps the browser puts in there?) Question = How to stop the the "Status: 500 Internal Server Error.." message being inserted mysteriously at the top of the 500.html page? (or do I have to redirect to a rails action/view for errors to solve this? (guess this won''t be very good if rails itself is the issue and is not working - or perhaps do this for exception you catch and leave the 500 error mechanism unchanged?) Regards Greg On 8/21/06, Adam Fields <rails23049809-CU8A4pfP4hodnm+yROfE0A@public.gmane.org> wrote:> > > I''ve overridden the default error handling mechanism with a custom > error handler library that''s included in environment.rb: > > ---------------------------------------------- > class ActionController::Base > def rescue_action_in_public(exception) > case exception > when ActionController::UnknownAction then > render(:file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not > Found") > else > render(:file => "#{RAILS_ROOT}/public/500.html", :status => "500 > Error") > end > end > end > ---------------------------------------------- > > This works fine, and my custom error message gets displayed. However, > before it in the source of the html page, this is still being inserted: > > Status: 500 Internal Server Error > Content-Type: text/html > > How do I turn that off and display just the custom error page? > > Thanks! > > -- > - Adam > > ** Expert Technical Project and Business Management > **** System Performance Analysis and Architecture > ****** [ http://www.adamfields.com ] > > [ http://www.aquick.org/blog ] ............ Blog > [ http://www.adamfields.com/resume.html ].. Experience > [ http://www.flickr.com/photos/fields ] ... Photos > [ http://www.aquicki.com/wiki ].............Wiki > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Smith
2007-Sep-11 22:03 UTC
Re: Custom 500 error handler still displaying default error
Has anyone figured out this problem? I noticed that it occurs with the default 500.html display as well. Greg Hauptmann wrote:> Adam/All, > > Did you work this out / know how to fix this? I''m seeing the same thing > here (i.e. want to stop that text at the top of the page coming in, it''s > as > if it''s part of the HTTP 500 error message process that perhaps the > browser > puts in there?) > > Question = How to stop the the "Status: 500 Internal Server Error.." > message > being inserted mysteriously at the top of the 500.html page? (or do I > have > to redirect to a rails action/view for errors to solve this? (guess > this > won''t be very good if rails itself is the issue and is not working - or > perhaps do this for exception you catch and leave the 500 error > mechanism > unchanged?) > > Regards > Greg-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---