Skip to content

Commit

Permalink
UX: Warn in /logs when PM is not sent (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
nattsw authored Dec 11, 2023
1 parent 3dd5ad0 commit 9bd7019
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ module ::DiscourseDataExplorer
DiscourseDataExplorer::ReportGenerator.new(automation.last_updated_by_id)
report_pms = data_explorer_report.generate(query_id, query_params, recipients)

report_pms.each { |pm| utils.send_pm(pm, automation_id: automation.id) }
report_pms.each do |pm|
begin
utils.send_pm(pm, automation_id: automation.id)
rescue ActiveRecord::RecordNotSaved => e
Rails.logger.warn "#{DiscourseDataExplorer::PLUGIN_NAME} - couldn't send PM for automation #{automation.id}: #{e.message}"
end
end
end
end
end
Expand Down

0 comments on commit 9bd7019

Please sign in to comment.