Skip to content
bugsnag exception notifier written in crystal. Supports sidekiq.cr, kemal, HTTP::Server.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec
src
.gitignore
.travis.yml
Dockerfile
LICENSE
README.md
docker-compose.yml
shard.yml

README.md

bugsnag.cr

Build Status

bugsnag exception notifier written in crystal. Supports sidekiq.cr, kemal, HTTP::Server.

bugsnag.cr is heavily inspired by (read: stolen) airbrake-crystal. Thanks.

Usage

Reporting handled exceptions:

require "bugsnag"

begin
  raise "Something went wrong!"
rescue => exception
  Bugsnag.notify(exception)
end

sidekiq

require "bugsnag"
require "bugsnag/sidekiq"

cli = Sidekiq::CLI.new
server = cli.configure do |config|
  config.server_middleware.add Bugsnag::Sidekiq.new
end

HTTP::Server

require "http/server"
require "bugsnag"
require "bugsnag/http_handler"

server = HTTP::Server.new("0.0.0.0", 1337,
  [
    Bugsnag::HttpHandler.new
  ]) do |context|
    raise "narf"
end

server.listen

Kemal

require "kemal"
require "bugsnag"
require "bugsnag/http_handler"

add_handler Bugsnag::HttpHandler.new

get "/" do |env|
  raise "narf"
end

Kemal.run

Configuration

require "bugsnag"

Bugsnag.configure do |config|
  config.api_key = "YOUR_API_KEY_HERE"
end

Installation

Add bugsnag.cr as a dependency in shards.yml

dependencies:
  bugsnag:
    github: gewo/bugsnag.cr

Run shards update to download.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.