DEV: Improve logging of errors in `Jobs::ProcessUserNotificationSchedules`

DEV: Improve logging of errors in Jobs::ProcessUserNotificationSchedules

Gives us the actual error and backtrace to work with. Otherwise, the logging of the error is not useful at all.

diff --git a/app/jobs/scheduled/process_user_notification_schedules.rb b/app/jobs/scheduled/process_user_notification_schedules.rb
index a82db6e..1e793e0 100644
--- a/app/jobs/scheduled/process_user_notification_schedules.rb
+++ b/app/jobs/scheduled/process_user_notification_schedules.rb
@@ -8,8 +8,8 @@ module Jobs
       UserNotificationSchedule.enabled.includes(:user).each do |schedule|
         begin
           schedule.create_do_not_disturb_timings
-        rescue
-          Rails.logger.warn("Failed to process user_notification_schedule with ID #{schedule.id}")
+        rescue => e
+          Discourse.warn_exception(e, message: "Failed to process user_notification_schedule with ID #{schedule.id}")
         end
       end
     end

GitHub sha: 0d8144b62b7b685f4be1d7faf4abcc22605618ef

This commit appears in #13802 which was approved by martin. It was merged by tgxworld.