# 500 Error Page

**URL:** <https://www.ruby-forum.com/t/500-error-page/68453>\
**Category:** Rails\
**Created:** [December 16, 2005, 2:41am UTC](https://www.ruby-forum.com/t/500-error-page/68453 "2005-12-16T02:41:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HunterSs\_Lists](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6bbea6/32.png) [@HunterSs\_Lists](https://www.ruby-forum.com/u/HunterSs_Lists)\
**Post date:** [December 16, 2005, 2:41am UTC](https://www.ruby-forum.com/t/500-error-page/68453/1 "2005-12-16T02:41:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![HunterSs\_Lists](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6bbea6/32.png) [@HunterSs\_Lists](https://www.ruby-forum.com/u/HunterSs_Lists)\
**Post date:** [December 16, 2005, 4:18am UTC](https://www.ruby-forum.com/t/500-error-page/68453/2 "2005-12-16T04:18:01Z")

</div>

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

> 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: [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/)  
HowtoConfigureTheErrorPageForYourRailsApp

Cheers-

-Ezra Z.  
WebMaster  
Yakima Herald-Republic Newspaper  
removed\_email\_address@domain.invalid  
509-577-7732
