lib/gitlab_exporter/database/base.rb in gitlab-exporter-8.0.0 vs lib/gitlab_exporter/database/base.rb in gitlab-exporter-9.0.0
- old
+ new
@@ -29,16 +29,14 @@
self.class.connection_pool[@connection_string]
end
def with_connection_pool
connection_pool.with do |conn|
- begin
- yield conn
- rescue PG::UnableToSend => e
- @logger.warn "Error sending to the database: #{e}" if @logger
- conn.reset
- raise e
- end
+ yield conn
+ rescue PG::UnableToSend => e
+ @logger.warn "Error sending to the database: #{e}" if @logger
+ conn.reset
+ raise e
end
rescue PG::Error => e
@logger.error "Error connecting to the database: #{e}" if @logger
raise e
end