diff --git a/lib/pact_broker/app.rb b/lib/pact_broker/app.rb index 05b104866..29cc5adc5 100644 --- a/lib/pact_broker/app.rb +++ b/lib/pact_broker/app.rb @@ -45,6 +45,7 @@ def post_configure PactBroker.logger = configuration.logger SuckerPunch.logger = configuration.logger configure_database_connection + configure_sucker_punch end def migrate_database @@ -119,6 +120,12 @@ def build_diagnostic builder end + def configure_sucker_punch + SuckerPunch.exception_handler = -> (ex, klass, args) do + PactBroker.log_error(ex, "Unhandled Suckerpunch error for #{klass}.perform(#{args.inspect})") + end + end + def running_app @running_app ||= begin apps = @cascade_apps