Rescue_action_in_public useless to capture low level errors

Hi all,

I’m trying to make for nicer system error handling, with the help of
rescue_action_in_public
(see Recipe 47, in ‘Rails Recipes’)

PROBLEM:
While it lets me capture an incorrect db name in database.yml (for
example),
with lower level errors like when the DB server is just down, I still
get the default system error screen for MySQL::ERROR :

Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
(2)
RAILS_ROOT: xxx/test_recover/public/…/config/…

and the ugly stack trace (see end of message)

QUESTION:
Is there anything I can do to capture and handle low levers errors like
this one?

Thanks in advance.

Alain R.

Error screen contents:

Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
(2)
RAILS_ROOT: xxx/test_recover/public/…/config/…

/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:in
real_connect' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:331:inconnect’
/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:165:in
reconnect!' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:85:inverify!’
/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:99:in
verify_active_connections!' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:98:inverify_active_connections!’
/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:70:in
prepare_application' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:37:indispatch’
/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in
process_request' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:inprocess!’
/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:600:in
each_cgi' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1/fcgi.rb:597:ineach_cgi’
/Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in
process!' /Applications/__my/__dev/Locomotive2/Bundles/rails112.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:inprocess!’
/Users/aravet/test_recover/public/dispatch.fcgi:24

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs