Skip to content

Commit

Permalink
feat(webhook status): log unhandled suckerpunch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Sep 6, 2017
1 parent c9272dc commit 4cc779d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/pact_broker/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4cc779d

Please sign in to comment.