Honeybadger for Crystal

Source Code

Getting Started

Update your shard.yml to include honeybadger:

dependencies:
+  honeybadger:
+    github: honeybadger-io/honeybadger-crystal

Add the Honeybadger::Handler to the HTTP::Server stack:

honeybadger_api_key = ENV["HONEYBADGER_API_KEY"]? || "00000000"
honeybadger_enabled = MyServer.production?

Honeybadger.configure(api_key: honeybadger_api_key)

Honeybadger::Handler.new(
  enabled: honeybadger_enabled,
  factory: Honeybadger::Payload
)

Details for adding the handler to:

You can also manually report exceptions to Honeybadger like so:

begin
  raise "OH NO!"
rescue exception
  Honeybadger.notify(exception)
end

Version Requirements

Crystal > 0.36.1