Skip to content

Commit 6b73a4e

Browse files
committed
raise ConnectionNotEstabilished when TinyTDS returns false
1 parent 470c569 commit 6b73a4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ def initialize_type_map(m = type_map)
375375

376376
def translate_exception(e, message:, sql:, binds:)
377377
case message
378-
when /SQL Server client is not connected/
378+
when /(SQL Server client is not connected)|(failed to execute statement)/i
379379
ConnectionNotEstablished.new(message)
380380
when /(cannot insert duplicate key .* with unique index) | (violation of unique key constraint)/i
381381
RecordNotUnique.new(message, sql: sql, binds: binds)

0 commit comments

Comments
 (0)