Module: ActiveRecord::ConnectionAdapters::Sqlserver::Errors
- Included in:
- ActiveRecord::ConnectionAdapters::SQLServerAdapter
- Defined in:
- lib/active_record/connection_adapters/sqlserver/errors.rb
Constant Summary collapse
- LOST_CONNECTION_EXCEPTIONS =
{ :dblib => ['TinyTds::Error'], :odbc => ['ODBC::Error','ODBC_UTF8::Error','ODBC_NONE::Error'], :adonet => ['TypeError','System::Data::SqlClient::SqlException'] }.freeze
- LOST_CONNECTION_MESSAGES =
{ :dblib => [/closed connection/, /dead or not enabled/, /server failed/i], :odbc => [/link failure/, /server failed/, /connection was already closed/, /invalid handle/i], :adonet => [/current state is closed/, /network-related/] }.freeze
Instance Method Summary collapse
Instance Method Details
#lost_connection_exceptions ⇒ Object
23 24 25 26 |
# File 'lib/active_record/connection_adapters/sqlserver/errors.rb', line 23 def lost_connection_exceptions exceptions = LOST_CONNECTION_EXCEPTIONS[@connection_options[:mode]] @lost_connection_exceptions ||= exceptions ? exceptions.map{ |e| e.constantize rescue nil }.compact : [] end |
#lost_connection_messages ⇒ Object
28 29 30 |
# File 'lib/active_record/connection_adapters/sqlserver/errors.rb', line 28 def LOST_CONNECTION_MESSAGES[@connection_options[:mode]] end |