lib/airbrake/rake.rb in airbrake-8.1.4 vs lib/airbrake/rake.rb in airbrake-8.2.0

- old
+ new

@@ -22,18 +22,19 @@ # rubocop:enable Lint/RescueException private def notify_airbrake(exception, args) - Airbrake.notify_sync(exception) do |notice| - notice[:context][:component] = 'rake' - notice[:context][:action] = name - notice[:params].merge!( - rake_task: task_info, - execute_args: args, - argv: ARGV.join(' ') - ) - end + notice = Airbrake.build_notice(exception) + notice[:context][:component] = 'rake' + notice[:context][:action] = name + notice[:params].merge!( + rake_task: task_info, + execute_args: args, + argv: ARGV.join(' ') + ) + + Airbrake.notify_sync(notice) end # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize def task_info info = {}