Improved handling of non StandardError exceptions in Scheduler Threads for better debugging, reasoning and error handling of Scheduler threads.

This commit is contained in:
Thorsten Eckel 2018-01-09 17:47:43 +01:00
parent 48f3a7efe5
commit 405a8ce77b

View file

@ -209,6 +209,13 @@ class Scheduler < ApplicationModel
active: false,
)
end
# rescue any other Exceptions that are not StandardError or childs of it
# https://stackoverflow.com/questions/10048173/why-is-it-bad-style-to-rescue-exception-e-in-ruby
# http://rubylearning.com/satishtalim/ruby_exceptions.html
rescue Exception => e # rubocop:disable Lint/RescueException
logger.error "execute #{job.method} (try_count #{try_count}) exited with a non standard-error #{e.inspect}"
raise
end
def self.worker(foreground = false)