mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
The behaviour was set to `notify` already but we were missing a notification handler. Now we'll get alerted about deprecations which were not covered by specs.
15 lines
398 B
Ruby
15 lines
398 B
Ruby
# frozen_string_literal: true
|
|
|
|
ActiveSupport::Notifications.subscribe(/deprecation/) do |_name, _start, _finish, _id, payload|
|
|
e = ActiveSupport::DeprecationException.new(payload[:message])
|
|
e.set_backtrace(payload[:callstack].map(&:to_s))
|
|
|
|
Bugsnag.notify(e) do |report|
|
|
report.severity = "warning"
|
|
report.add_tab(
|
|
:deprecation,
|
|
payload.except(:callstack),
|
|
)
|
|
end
|
|
end
|