From 4cc779d89034e7074e5eab440e549cdee25fafea Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Wed, 6 Sep 2017 18:02:42 +1000 Subject: [PATCH] feat(webhook status): log unhandled suckerpunch errors --- lib/pact_broker/app.rb | 7 +++++++ 1 file changed, 7 insertions(+) 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