Sha256: fdd14022061a5aec3828cebeebdf1bc0b98722bab293e16dca5ab29f523ed356
Contents?: true
Size: 957 Bytes
Versions: 13
Compression:
Stored size: 957 Bytes
Contents
module ActiveRecord class LostConnection < WrappedDatabaseException end class DeadlockVictim < WrappedDatabaseException end module ConnectionAdapters module Sqlserver module Errors LOST_CONNECTION_EXCEPTIONS = { dblib: ['TinyTds::Error'], odbc: ['ODBC::Error'] }.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] }.freeze def lost_connection_exceptions exceptions = LOST_CONNECTION_EXCEPTIONS[@connection_options[:mode]] @lost_connection_exceptions ||= exceptions ? exceptions.map { |e| e.constantize rescue nil }.compact : [] end def lost_connection_messages LOST_CONNECTION_MESSAGES[@connection_options[:mode]] end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems