jt-rails-toolbox 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 844f258e0659fee463d6ea2465a283bb42402cb6
4
- data.tar.gz: 3b8145a50885a5c2eb5a7051c41a4aa107b632f8
3
+ metadata.gz: 0def6e9f02f0f92926dae61892361bbcd484e4d6
4
+ data.tar.gz: 9ad82a888f55ed5e99289b424dc3fa5c26229416
5
5
  SHA512:
6
- metadata.gz: b649badbb99452621dec6a1c8371baab5b2f914b4887bb3b7af98cd9ea85d99f3dc120c74eb25b683e95a1d207a85d6aea722eca5c27a00cb5f803e73387a011
7
- data.tar.gz: f246dfd58a8c606d633e8413c7762320a82bae9d6135fe9bb5e3584bb99522a1ad499c2e64b42b4638f2c61419aba414737f40dc9747920776394b64aa286598
6
+ metadata.gz: f7b8d40bd2c321af8d74c68850fe2bae1a17f08a94dfe57b81838f530a3a64c34a062170814b4b4bd5703b4c0eff93c3fa44983ede871e063bd52db07161ecfa
7
+ data.tar.gz: b079ab4e41d7dc4f3e9199de2d9b0f0a7de7fd3903a04990f9822a1925ddd3c057d9f867444b1ae3e9f334d4ee19783c164e4bdd21984f77dcbee61aa2687ec8
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
3
3
  s.summary = "Common libs used for Ruby On Rails development."
4
4
  s.description = "JTRailsToolbox contains a list of common libs used for Ruby On Rails development."
5
5
  s.homepage = 'https://github.com/jonathantribouharet/jt-rails-toolbox'
6
- s.version = '2.2.0'
6
+ s.version = '2.2.1'
7
7
  s.files = `git ls-files`.split("\n")
8
8
  s.require_paths = ['lib']
9
9
  s.authors = ['Jonathan TRIBOUHARET']
@@ -75,8 +75,10 @@ module JTRailsToolbox
75
75
  require 'exception_notification/rails'
76
76
  require 'exception_notification/sidekiq'
77
77
 
78
+ exceptions_to_ignore = %w{ActionController::InvalidCrossOriginRequest ActionController::InvalidAuthenticityToken}
79
+
78
80
  ExceptionNotification.configure do |config|
79
- config.ignored_exceptions += ['ActionController::InvalidCrossOriginRequest', 'ActionController::InvalidAuthenticityToken']
81
+ config.ignored_exceptions += exceptions_to_ignore
80
82
 
81
83
  if !@params['exception']['slack_webhook_url'].blank?
82
84
  config.add_notifier :slack, {
@@ -100,6 +102,12 @@ module JTRailsToolbox
100
102
  require 'airbrake'
101
103
  require 'airbrake/sidekiq/error_handler'
102
104
 
105
+ # Default ignored exceptions in Exception Notification
106
+ exceptions_to_ignore = %w{ActiveRecord::RecordNotFound Mongoid::Errors::DocumentNotFound AbstractController::ActionNotFound ActionController::RoutingError ActionController::UnknownFormat ActionController::UrlGenerationError}
107
+
108
+ # Additionnal exceptions to ignore
109
+ exceptions_to_ignore.push *%w{ActionController::InvalidCrossOriginRequest ActionController::InvalidAuthenticityToken}
110
+
103
111
  Airbrake.configure do |c|
104
112
  if @params['airbrake']['host']
105
113
  c.host = @params['airbrake']['host']
@@ -107,6 +115,7 @@ module JTRailsToolbox
107
115
 
108
116
  c.project_id = @params['airbrake']['project_id']
109
117
  c.project_key = @params['airbrake']['project_key']
118
+
110
119
  c.environment = Rails.env
111
120
 
112
121
  if @params['airbrake']['ignore_environments']
@@ -115,6 +124,12 @@ module JTRailsToolbox
115
124
  c.ignore_environments = %w(development test)
116
125
  end
117
126
  end
127
+
128
+ Airbrake.add_filter do |notice|
129
+ if notice[:errors].any? { |error| exceptions_to_ignore.include?(error[:type]) }
130
+ notice.ignore!
131
+ end
132
+ end
118
133
  end
119
134
 
120
135
  def configure_mail(app)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jt-rails-toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan TRIBOUHARET