Search code examples
ruby-on-railsrubyclockwork

Send errors from rails clockwork gem to airbrake?


What is the best way to send errors from clockwork to Airbrake?


Solution

  • Just add the following to your clockwork definition:

    module Clockwork
      error_handler do |error|
        Airbrake.notify_or_ignore(error)
      end
    
      # existing configuration
    end
    

    See: Clockwork Docs about error_handler