sentry-raven 2.8.0 → 2.9.0
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/changelog.md +6 -0
- data/lib/raven/base.rb +1 -0
- data/lib/raven/configuration.rb +18 -3
- data/lib/raven/event.rb +1 -15
- data/lib/raven/utils/exception_cause_chain.rb +19 -0
- data/lib/raven/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32a99e5dd16326a16bdb037f3773713c67b94435
|
4
|
+
data.tar.gz: b54fdea58fbc249a01220ee8d16b29122fb9c36b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55835591bde885dead10c56f4f8bd311becd2da910b761be9056a4d9f4519356ad6602e6a36f55891176f3e733ac359ab74c893908c97e81d0706fbb04d51bdc
|
7
|
+
data.tar.gz: a1e7af3943cf1fa7e8bf779ad348378439d82b548a729ac765110f8e90c558623c038082cd5e211540fa05cbaf153723d2351c355f0dbd4d92817650783f4aec
|
data/changelog.md
CHANGED
data/lib/raven/base.rb
CHANGED
data/lib/raven/configuration.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'uri'
|
2
2
|
|
3
3
|
module Raven
|
4
|
-
class Configuration
|
4
|
+
class Configuration # rubocop:disable Metrics/ClassLength
|
5
5
|
# Directories to be recognized as part of your app. e.g. if you
|
6
6
|
# have an `engines` dir at the root of your project, you may want
|
7
7
|
# to set this to something like /(app|config|engines|lib)/
|
@@ -31,6 +31,10 @@ module Raven
|
|
31
31
|
# You should probably append to this rather than overwrite it.
|
32
32
|
attr_accessor :excluded_exceptions
|
33
33
|
|
34
|
+
# Boolean to check nested exceptions when deciding if to exclude. Defaults to false
|
35
|
+
attr_accessor :inspect_exception_causes_for_exclusion
|
36
|
+
alias inspect_exception_causes_for_exclusion? inspect_exception_causes_for_exclusion
|
37
|
+
|
34
38
|
# DSN component - set automatically if DSN provided
|
35
39
|
attr_accessor :host
|
36
40
|
|
@@ -205,6 +209,7 @@ module Raven
|
|
205
209
|
self.environments = []
|
206
210
|
self.exclude_loggers = []
|
207
211
|
self.excluded_exceptions = IGNORE_DEFAULT.dup
|
212
|
+
self.inspect_exception_causes_for_exclusion = false
|
208
213
|
self.linecache = ::Raven::LineCache.new
|
209
214
|
self.logger = ::Raven::Logger.new(STDOUT)
|
210
215
|
self.open_timeout = 1
|
@@ -349,14 +354,24 @@ module Raven
|
|
349
354
|
logger.error "Error detecting release: #{ex.message}"
|
350
355
|
end
|
351
356
|
|
352
|
-
def excluded_exception?(
|
353
|
-
excluded_exceptions.any?
|
357
|
+
def excluded_exception?(incoming_exception)
|
358
|
+
excluded_exceptions.any? do |excluded_exception|
|
359
|
+
matches_exception?(get_exception_class(excluded_exception), incoming_exception)
|
360
|
+
end
|
354
361
|
end
|
355
362
|
|
356
363
|
def get_exception_class(x)
|
357
364
|
x.is_a?(Module) ? x : qualified_const_get(x)
|
358
365
|
end
|
359
366
|
|
367
|
+
def matches_exception?(excluded_exception_class, incoming_exception)
|
368
|
+
if inspect_exception_causes_for_exclusion?
|
369
|
+
Raven::Utils::ExceptionCauseChain.exception_to_array(incoming_exception).any? { |cause| excluded_exception_class === cause }
|
370
|
+
else
|
371
|
+
excluded_exception_class === incoming_exception
|
372
|
+
end
|
373
|
+
end
|
374
|
+
|
360
375
|
# In Ruby <2.0 const_get can't lookup "SomeModule::SomeClass" in one go
|
361
376
|
def qualified_const_get(x)
|
362
377
|
x = x.to_s
|
data/lib/raven/event.rb
CHANGED
@@ -139,7 +139,7 @@ module Raven
|
|
139
139
|
|
140
140
|
def add_exception_interface(exc)
|
141
141
|
interface(:exception) do |exc_int|
|
142
|
-
exceptions =
|
142
|
+
exceptions = Raven::Utils::ExceptionCauseChain.exception_to_array(exc).reverse
|
143
143
|
backtraces = Set.new
|
144
144
|
exc_int.values = exceptions.map do |e|
|
145
145
|
SingleExceptionInterface.new do |int|
|
@@ -237,20 +237,6 @@ module Raven
|
|
237
237
|
].map { |v| v.new(self) }
|
238
238
|
end
|
239
239
|
|
240
|
-
def exception_chain_to_array(exc)
|
241
|
-
if exc.respond_to?(:cause) && exc.cause
|
242
|
-
exceptions = [exc]
|
243
|
-
while exc.cause
|
244
|
-
exc = exc.cause
|
245
|
-
break if exceptions.any? { |e| e.object_id == exc.object_id }
|
246
|
-
exceptions << exc
|
247
|
-
end
|
248
|
-
exceptions.reverse!
|
249
|
-
else
|
250
|
-
[exc]
|
251
|
-
end
|
252
|
-
end
|
253
|
-
|
254
240
|
def list_gem_specs
|
255
241
|
# Older versions of Rubygems don't support iterating over all specs
|
256
242
|
Hash[Gem::Specification.map { |spec| [spec.name, spec.version.to_s] }] if Gem::Specification.respond_to?(:map)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Raven
|
2
|
+
module Utils
|
3
|
+
module ExceptionCauseChain
|
4
|
+
def self.exception_to_array(exception)
|
5
|
+
if exception.respond_to?(:cause) && exception.cause
|
6
|
+
exceptions = [exception]
|
7
|
+
while exception.cause
|
8
|
+
exception = exception.cause
|
9
|
+
break if exceptions.any? { |e| e.object_id == exception.object_id }
|
10
|
+
exceptions << exception
|
11
|
+
end
|
12
|
+
exceptions
|
13
|
+
else
|
14
|
+
[exception]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/raven/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-raven
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- lib/raven/transports/http.rb
|
97
97
|
- lib/raven/transports/stdout.rb
|
98
98
|
- lib/raven/utils/deep_merge.rb
|
99
|
+
- lib/raven/utils/exception_cause_chain.rb
|
99
100
|
- lib/raven/utils/real_ip.rb
|
100
101
|
- lib/raven/version.rb
|
101
102
|
- lib/sentry-raven-without-integrations.rb
|