Use GitHub to track your application errors!
Rails exceptions automatically opened as issues on GitHub
If it is a bug please open an issue on GitHub.
PartyFoul captures exceptions in your application and does the
following:
bug. A new comment is added with relevant data on the
application state.regression tag is
added. A new comment is added with relevant data on the
application state.wontfix the issue is not updated nor is
a new issue created. No comments are added.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:
gem 'party_foul'If you are using Rails you can run the install generator.
rails g party_foul:installThis 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
config.middleware.use('PartyFoul::Middleware')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:
curl -u -i -d "{ \"scopes\": [\"repo\"], \"note\":[\"Test\"] }" \
https://api.github.com/authorizationsYou can specify an additional array of labels that will be applied to the issues PartyFoul creates.
PartyFoul.configure do |config|
config.additional_labels = ['front-end']
endYou can also provide a Proc that is passed the exception and the environment.
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
endIn 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
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
endThis will pass the worker class name and queue as well as all worker-related parameters off to PartyFoul before passing on the exception.
We are very thankful for the many contributors
This gem follows Semantic Versioning
Please do! We are always looking to improve this gem. Please see our Contribution Guidelines on how to properly submit issues and pull requests.
DockYard, LLC © 2013
No open issues yet, or sync has not completed.