Skip to content

Commit

Permalink
raise ConnectionNotEstabilished when TinyTDS returns false
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrunberg committed Apr 27, 2021
1 parent 470c569 commit fd30c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_record/connection_adapters/sqlserver_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def initialize_type_map(m = type_map)

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

0 comments on commit fd30c0d

Please sign in to comment.