# Handling MySQL Connection failures

**URL:** <https://www.ruby-forum.com/t/handling-mysql-connection-failures/87142>\
**Category:** Rails\
**Created:** [February 28, 2007, 2:25pm UTC](https://www.ruby-forum.com/t/handling-mysql-connection-failures/87142 "2007-02-28T14:25:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pallan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@pallan](https://www.ruby-forum.com/u/pallan)\
**Post date:** [February 28, 2007, 2:25pm UTC](https://www.ruby-forum.com/t/handling-mysql-connection-failures/87142/1 "2007-02-28T14:25:13Z")

</div>

Hi all,

Hopefully a quick question for someone. This morning we had our  
database server go down and that caused out Rails app to just spit out  
“Application Error” to all access. Is there a way to catch the  
exception for the mysql connection failure to allow a redirect to a  
static page?

Thanks

Peer

---

<div class="post-metadata">

**Author:** ![pallan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/71c47a/32.png) [@pallan](https://www.ruby-forum.com/u/pallan)\
**Post date:** [February 28, 2007, 2:43pm UTC](https://www.ruby-forum.com/t/handling-mysql-connection-failures/87142/2 "2007-02-28T14:43:56Z")

</div>

On 2/28/07, Peer A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,
> 
> Hopefully a quick question for someone. This morning we had our  
> database server go down and that caused out Rails app to just spit out  
> “Application Error” to all access. Is there a way to catch the  
> exception for the mysql connection failure to allow a redirect to a  
> static page?

With rails 1.2, i believe in case of ANY error, rails would display  
500.html page from /public directory, so you can design that page to  
look better and avoid “Application Error”.

## – gnufied

There was only one Road; that it was like a great river: its springs  
were at every doorstep, and every path was its tributary.  
[http://people.inxsasia.com/~hemant](http://people.inxsasia.com/~hemant)
