diff --git a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb index b8bfb629099..7cc4dce92bd 100644 --- a/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb +++ b/lib/active_record/connection_adapters/postgresql_fallback_adapter.rb @@ -154,7 +154,7 @@ module ActiveRecord begin connection = postgresql_connection(config) fallback_handler.initialized ||= true - rescue PG::ConnectionBad => e + rescue ::ActiveRecord::NoDatabaseError, PG::ConnectionBad => e fallback_handler.master_down fallback_handler.verify_master