{"id":13879037,"url":"https://github.com/rootstrap/exception_hunter","last_synced_at":"2025-07-14T11:12:37.283Z","repository":{"id":43075105,"uuid":"245486734","full_name":"rootstrap/exception_hunter","owner":"rootstrap","description":"Crash reporting engine to hunt down bugs 🐞","archived":false,"fork":false,"pushed_at":"2023-01-19T18:05:21.000Z","size":659,"stargazers_count":82,"open_issues_count":16,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-06-21T18:46:27.571Z","etag":null,"topics":["exception-hunter","exception-reporting","exception-tracker","gem","hacktoberfest","rails","rails-engine","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://rootstrap.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootstrap.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"MIT-LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-03-06T18:05:36.000Z","updated_at":"2025-03-25T17:53:26.000Z","dependencies_parsed_at":"2023-02-11T14:30:55.961Z","dependency_job_id":null,"html_url":"https://github.com/rootstrap/exception_hunter","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rootstrap/exception_hunter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fexception_hunter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fexception_hunter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fexception_hunter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fexception_hunter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootstrap","download_url":"https://codeload.github.com/rootstrap/exception_hunter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootstrap%2Fexception_hunter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265281824,"owners_count":23739886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exception-hunter","exception-reporting","exception-tracker","gem","hacktoberfest","rails","rails-engine","ruby-on-rails"],"created_at":"2024-08-06T08:02:07.655Z","updated_at":"2025-07-14T11:12:37.259Z","avatar_url":"https://github.com/rootstrap.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# ExceptionHunter\n\n![CI](https://github.com/rootstrap/exception_hunter/workflows/Rails%20tests/badge.svg)\n[![Maintainability](https://api.codeclimate.com/v1/badges/86f6aaa2377c894f8ee4/maintainability)](https://codeclimate.com/github/rootstrap/exception_hunter/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/86f6aaa2377c894f8ee4/test_coverage)](https://codeclimate.com/github/rootstrap/exception_hunter/test_coverage)\n\n![Index screenshot](docs/index-screenshot.png)\n\nException Hunter is a Rails engine meant to track errors in your Rails project. It works\nby using your Postgres database to save errors with their corresponding metadata (like backtrace\nor environment data at the time of failure).\n\nTo do so we hook to various points of your application where we can rescue from errors, track and\nthen re-raise those errors so they are handled normally. As such, the gem does not conflict with any\nother service so you can have your favorite error tracking service running in parallel with Exception Hunter\nwhile you decide which you like best.\n\n## Motivation\n\nError tracking is one of the most important tools a developer can have in their toolset. As such\nwe think it'd be nice to provide a way for everyone to have it in their project, be it a personal\nproject, and MVP or something else.\n\n## Docs\n\nYou can check the full documentation at [https://rootstrap.github.io/exception_hunter](https://rootstrap.github.io/exception_hunter).\n\n## Installation\n\nAdd Exception Hunter to your application's Gemfile:\n\n```ruby\ngem 'exception_hunter', '~\u003e 1.0'\n```\n\nYou may also need to add [Devise](https://github.com/heartcombo/devise) to your Gemfile\nif you haven't already done so and plan to use the gem's built in authentication:\n\n```ruby\ngem 'devise'\n```\n\nAfter installing the dependencies you'll want to run:\n\n```bash\n$ rails generate exception_hunter:install\n```\n\nThis will create an initializer and invoke Devise to\ncreate an `AdminUser` which will be used for authentication to access the dashboard. If you already\nhave this user created ([ActiveAdmin](https://github.com/activeadmin/activeadmin) uses the same model)\nyou can run the command with the `--skip-users` flag.\n\nAdditionally it should add the 'ExceptionHunter.routes(self)' line to your routes, which means you can go to\n`/exception_hunter/errors` in your browser and start enjoying some good old fashioned exception tracking!\n\n#### Testing it on dev:\n\nExceptionHunter is disabled on dev by default so if you want to test it before shipping it to another\nenvironment, which we highly recommend, you should enable it by going to the initializer and changing the\nline that says `config.enabled = !(Rails.env.development? || Rails.env.test?)` with something like\n`config.enabled = !(Rails.env.test?)` while you test. Don't forget to change it back if you don't\nwant a bunch of errors in your local DB!\n\nYou can then open a `rails console` and manually track an exception to check that it\nworks `ExceptionHunter.track(StandardError.new(\"It works!\"))`. You should now see the exception\non [http://localhost:3000/exception_hunter]().\n\n## Stale data\n\nYou can get rid of stale errors by running the rake task to purge them:\n\n```bash\n$ rake exception_hunter:purge_errors\n```\n\nWe recommend you run this task once in a while to de-clutter your DB, using a recurring tasks once\na week would be ideal. You can also purge errors by running `ExceptionHunter::ErrorReaper.purge`.\n\nThe time it takes for an error to go stale defaults to 45 days but it's configurable via the initializer.\n\n## Manual tracking\n\nExceptionHunter also includes a facility to manually log from anywhere in the code. Imagine the following case:\n\n```ruby\ncase current_user.status\nwhen :inactive then do_something\nwhen :active then do_something_else\nwhen :banned then do_something_else_else\nelse\n  ExceptionHunter.track(ArgumentError.new('This should never happen'), custom_data: { status: current_user.status }, user: current_user)\nend\n```\n\nIn this scenario we don't really want to raise an exception but we might want to be alerted if by any chance a user\nhas an invalid status.\n\n## Slack notifications\n\nYou can configure ExceptionHunter to send a message to slack every time an error occurs.\nYou have to do the following:\n\n1. Create a Slack app.\n1. Add it to your workspace.\n1. Add one or more webhooks linked to the channels you want to receive the notifications.\n1. Set the webhook urls in the `exception_hunter` initializer.\n\n```ruby\nconfig.notifiers \u003c\u003c {\n  name: :slack,\n  options: {\n    webhook: 'SLACK_WEBHOOK_URL_1'\n  }\n}\n\nconfig.notifiers \u003c\u003c {\n  name: :slack,\n  options: {\n    webhook: 'SLACK_WEBHOOK_URL_2'\n  }\n}\n```\n\n1. Add the code below to the environment config file where you are using ExceptionHunter with the correct server url.\n\n```ruby\nExceptionHunter::Engine.configure do |config|\n  config.routes.default_url_options = { host: \"your_server_url\" }\nend\n```\n\nThis uses ActiveJob to send notification in the background, so [make sure you configure](https://guides.rubyonrails.org/active_job_basics.html#setting-the-backend) it with the adapter you are using, if not notifications will be sent synchronously.\n\n## Async Logging\n\nYou can configure ExceptionHunter to log async when an error occurs.\nYou have to do the following:\n\n```ruby\nconfig.async_logging = true;\n```\n\nThis uses ActiveJob to log the error in the background, so [make sure you configure](https://guides.rubyonrails.org/active_job_basics.html#setting-the-backend) it with the adapter you are using, if not the error will be logged synchronously.\n\nNote: Errors from jobs will still be logged synchronously to not queue a job from a job (which sound like a bad idea)\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Credits\n\nException Hunter is maintained by [Rootstrap](http://www.rootstrap.com) with\nthe help of our [contributors](https://github.com/rootstrap/exception_hunter/contributors).\n\n[\u003cimg src=\"https://s3-us-west-1.amazonaws.com/rootstrap.com/img/rs.png\" width=\"100\"/\u003e](http://www.rootstrap.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fexception_hunter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootstrap%2Fexception_hunter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootstrap%2Fexception_hunter/lists"}