jam-cloud/ruby/lib/jam_ruby/db_util.rb

18 lines
423 B
Ruby
Raw Permalink Normal View History

module JamRuby
class DbUtil
def self.create(connection_hash)
end
BAD_CONN_EXCEPTIONS = [PG::UnableToSend, PG::ConnectionBad]
def self.bad_conn_exception?(exception)
test_exception = exception
if exception.class == ActiveRecord::StatementInvalid
test_exception = exception.original_exception
end
BAD_CONN_EXCEPTIONS.include?(test_exception.class)
end
end
end