What I want to do: redirect the user to a special error page if the database is down.
I'm using an Oracle database with the OCI adapter.
It appears that, if the database is unavailable (say, down for backup), that the OCI adapter throws an error before I ever hit a controller (based on the stack trace, it's while it's setting up the connection pool). So I can't use rescue_from
or rescue_action
, even in ApplicationController -- the rescue line is never reached.
Is there any way to "wrap" the initialization or otherwise rescue a particular error at a higher level (or earlier point) than ApplicationController?