Skip to content

Commit

Permalink
Ensure run_before_send_callbacks returns nil on a failure
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamineskola committed May 12, 2021
1 parent 7f34614 commit 4e33da5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/govuk_app_config/govuk_error/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ def increment_govuk_statsd_counters

def run_before_send_callbacks
lambda do |error_or_event, hint|
result = error_or_event
@before_send_callbacks.each do |callback|
break if callback.call(error_or_event, hint).nil?
result = callback.call(error_or_event, hint)
break if result.nil?
end
error_or_event
result
end
end
end
Expand Down

0 comments on commit 4e33da5

Please sign in to comment.