500 Error Page

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

500 Error Page

Hunter Hillegas-2
I have an error page defined in my .htaccess file and I'm in production
mode.

Sometimes I still get the Application Error (Rails) white page though. In
this case there was a nil object that I tried to access in a controller
without first checking if it was nil.

How does Rails decide what error page to display and how can I get the
pretty error page to display more often?

Thanks.


_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Reply | Threaded
Open this post in threaded view
|

Re: 500 Error Page

Ezra Zygmuntowicz

On Dec 15, 2005, at 5:40 PM, Hunter's Lists wrote:

> I have an error page defined in my .htaccess file and I'm in  
> production
> mode.
>
> Sometimes I still get the Application Error (Rails) white page  
> though. In
> this case there was a nil object that I tried to access in a  
> controller
> without first checking if it was nil.
>
> How does Rails decide what error page to display and how can I get the
> pretty error page to display more often?
>
> Thanks.


Hunter-

        I think what you are looking for is called rescue_action_in_public.  
You can use it like this:

In application.rb

def rescue_action_in_public(exception)
   # Do something with exception. Either throw
   # a 404 or send am email to your self in here.
   render :text => "My pretty 404 page. exception : #{exception }"
end


And here's a link to more:  http://wiki.rubyonrails.com/rails/pages/ 
HowtoConfigureTheErrorPageForYourRailsApp


Cheers-

-Ezra Zygmuntowicz
WebMaster
Yakima Herald-Republic Newspaper
[hidden email]
509-577-7732
_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails