Skip to content

Commit

Permalink
Handle Net errors
Browse files Browse the repository at this point in the history
  • Loading branch information
syabruk committed Aug 8, 2024
1 parent 7b837ef commit f95382a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def internal_exec_query(sql, name = nil, binds = [], prepare: false, async: fals
ActiveRecord::Result.new(result['meta'].map { |m| m['name'] }, result['data'], result['meta'].map { |m| [m['name'], type_map.lookup(m['type'])] }.to_h)
rescue ActiveRecord::ActiveRecordError => e
raise e
rescue Net::ReadTimeout, Net::WriteTimeout, Net::OpenTimeout => e
raise ActiveRecord::ConnectionFailed, "Response: #{e.message}"
rescue StandardError => e
raise ActiveRecord::ActiveRecordError, "Response: #{e.message}"
end
Expand Down

0 comments on commit f95382a

Please sign in to comment.