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 +4 -4
- data/jt-rails-toolbox.gemspec +1 -1
- data/lib/jt-rails-toolbox.rb +16 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0def6e9f02f0f92926dae61892361bbcd484e4d6
|
4
|
+
data.tar.gz: 9ad82a888f55ed5e99289b424dc3fa5c26229416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7b8d40bd2c321af8d74c68850fe2bae1a17f08a94dfe57b81838f530a3a64c34a062170814b4b4bd5703b4c0eff93c3fa44983ede871e063bd52db07161ecfa
|
7
|
+
data.tar.gz: b079ab4e41d7dc4f3e9199de2d9b0f0a7de7fd3903a04990f9822a1925ddd3c057d9f867444b1ae3e9f334d4ee19783c164e4bdd21984f77dcbee61aa2687ec8
|
data/jt-rails-toolbox.gemspec
CHANGED
@@ -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.
|
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']
|
data/lib/jt-rails-toolbox.rb
CHANGED
@@ -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 +=
|
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)
|