Skip to content

Commit

Permalink
Raise error
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan committed Oct 12, 2023
1 parent 46d304a commit 0305c14
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,15 @@ def _execute(sql, conn, perform_do: false)

# TODO: Remove
def dblib_execute(sql)
@raw_connection.execute(sql).tap do |result|
# TinyTDS returns false instead of raising an exception if connection fails.
# Getting around this by raising an exception ourselves while this PR
# https://github.com/rails-sqlserver/tiny_tds/pull/469 is not released.
raise TinyTds::Error, "failed to execute statement" if result.is_a?(FalseClass)
end
throw NotImplementedError


# @raw_connection.execute(sql).tap do |result|
# # TinyTDS returns false instead of raising an exception if connection fails.
# # Getting around this by raising an exception ourselves while this PR
# # https://github.com/rails-sqlserver/tiny_tds/pull/469 is not released.
# raise TinyTds::Error, "failed to execute statement" if result.is_a?(FalseClass)
# end
end

def ensure_established_connection!
Expand Down

0 comments on commit 0305c14

Please sign in to comment.