diff --git a/app/controllers/ping_controller.rb b/app/controllers/ping_controller.rb index 3373da09..8ba2a7ad 100644 --- a/app/controllers/ping_controller.rb +++ b/app/controllers/ping_controller.rb @@ -15,8 +15,9 @@ class PingController < ApplicationController private def postgres_connected! + # any unhandled exception leads to a HTTP 500 response. ApplicationRecord.establish_connection ApplicationRecord.connection - ApplicationRecord.connected? + raise ActiveRecord::ConnectionNotEstablished unless ApplicationRecord.connected? end end