0

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

knagode
  • 5,446
  • 5
  • 47
  • 62

2 Answers2

2

The airbrake library has an API to notify their service directly without raising an exception. Their GitHub has a ton of documentation on this.

Airbrake Ruby

You can do something like this:

Airbrake.notify("Opps!")
Leo Correa
  • 17,867
  • 2
  • 49
  • 69
1

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

spickermann
  • 89,540
  • 8
  • 92
  • 120