Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
P

party_foul

> 编程语言
Open source

Use GitHub to track your application errors!

512 stars0 likes3 views
WebsiteGitHub

About

Use GitHub to track your application errors!

PartyFoul

Rails exceptions automatically opened as issues on GitHub

Looking for help?

If it is a bug please open an issue on GitHub.

About

PartyFoul captures exceptions in your application and does the following:

  1. Attempt to find a matching issue in your GitHub repo
  2. If no matching issue is found, a new issue is created with a unique title, session information, and stack trace. The issue is tagged as a bug. A new comment is added with relevant data on the application state.
  3. If an open issue is found, the occurrence count and time stamp is updated. A new comment is added with relevant data on the application state.
  4. If a closed issue is found, the occurrence count and time stamp is updated. The issue is reopened and a regression tag is added. A new comment is added with relevant data on the application state.
  5. If the issue is marked as wontfix the issue is not updated nor is a new issue created. No comments are added.

Installation

Note We highly recommend that you create a new GitHub account that is a collaborator on your repository. Use this new account's credentials for the installation below. If you use your own account you will not receive emails when issues are created, updated, reopened, etc... because all of the work is done as your account.

In your Gemfile add the following:

ruby
gem 'party_foul'

Rails

If you are using Rails you can run the install generator.

rails g party_foul:install

This prompts you for the GitHub credentials of the account that is opening the issues. The OAuth token for that account is stored in config/initializers/party_foul.rb. You may want to remove the token string and store in an environment variable. It is best not to store the token in version control.

Add as the very last middleware in your production Rack stack in config/environments/production.rb

ruby
config.middleware.use('PartyFoul::Middleware')

Other

You need to initialize PartyFoul, use the following:

…

You can create an OAuth token or generate an OAuth token via the OAuth Authorizations API with cURL:

bash
curl -u  -i -d "{ \"scopes\": [\"repo\"], \"note\":[\"Test\"] }" \
https://api.github.com/authorizations

Customization

Labels

You can specify an additional array of labels that will be applied to the issues PartyFoul creates.

ruby
PartyFoul.configure do |config|
  config.additional_labels = ['front-end']
end

You can also provide a Proc that is passed the exception and the environment.

ruby
PartyFoul.configure do |config|
  config.additional_labels = Proc.new do |exception, env|
    labels = if env["HTTP_HOST"] =~ /beta\./
      ['beta']
    else
      ['production']
    end
    if exception.message =~ /PG::Error/
      labels  error
  PartyFoul::RacklessExceptionHandler.handle(error, class: class_name, method: method_name, params: message)
  raise error
end

Tracking errors in a Sidekiq worker

In order to use PartyFoul for exception handling with Sidekiq you will need to create an initializer with some middleware configuration. The following example is based on using Sidekiq with another exception notifier server.

File: config/initializers/partyfoul_sidekiq.rb

ruby
module PartyFoul
  class Sidekiq
    def call(worker, msg, queue)
      begin
        yield
      rescue => error
        PartyFoul::RacklessExceptionHandler.handle(error, {class: worker.class.name, method: queue, params: msg})
        raise error
      end
    end
  end
end

::Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add ::PartyFoul::Sidekiq
  end
end

This will pass the worker class name and queue as well as all worker-related parameters off to PartyFoul before passing on the exception.

Authors

  • Brian Cardarella
  • Dan McClain

We are very thankful for the many contributors

Versioning

This gem follows Semantic Versioning

Want to help?

Please do! We are always looking to improve this gem. Please see our Contribution Guidelines on how to properly submit issues and pull requests.

Legal

DockYard, LLC © 2013

@dockyard

Licensed under the MIT license

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ruby

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言