From 83fb7a769c82000de47fe264b3449b1b00b4b0c4 Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Fri, 23 Aug 2019 17:48:21 +0700 Subject: [PATCH] Ignore RecordNotFound exceptions in Errbit --- config/initializers/errbit.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/initializers/errbit.rb b/config/initializers/errbit.rb index 3eb211bcc..bb22b04ba 100644 --- a/config/initializers/errbit.rb +++ b/config/initializers/errbit.rb @@ -8,6 +8,11 @@ Airbrake.configure do |config| config.ignore_environments += [Rails.env] if Rails.application.secrets.errbit_project_id.blank? end +Airbrake.add_filter do |notice| + ignorables = %w[ActiveRecord::RecordNotFound] + notice.ignore! if ignorables.include? notice[:errors].first[:type] +end + if Rails.application.secrets.errbit_self_hosted_ssl.present? # Patch from: https://mensfeld.pl/2016/05/setting-up-errbit-reporter-airbrake-v5-gem-to-work-with-self-signed-https-certificate/ module Patches