sentry-raven 2.8.0 → 3.0.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 +5 -5
- data/.travis.yml +7 -11
- data/README.md +3 -3
- data/changelog.md +71 -1
- data/lib/raven/base.rb +2 -1
- data/lib/raven/breadcrumbs/logger.rb +1 -1
- data/lib/raven/client.rb +19 -6
- data/lib/raven/configuration.rb +24 -4
- data/lib/raven/event.rb +2 -22
- data/lib/raven/instance.rb +8 -0
- data/lib/raven/integrations/delayed_job.rb +2 -2
- data/lib/raven/integrations/rack.rb +1 -1
- data/lib/raven/integrations/rails/active_job.rb +6 -4
- data/lib/raven/integrations/rails/controller_transaction.rb +1 -1
- data/lib/raven/processor/utf8conversion.rb +1 -1
- data/lib/raven/utils/exception_cause_chain.rb +19 -0
- data/lib/raven/version.rb +1 -1
- data/sentry-raven.gemspec +3 -3
- metadata +6 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6c812e5ab292c9f9351064bfc75f13bf3f6fff8ea1163a79a0e7da2e5efa9afb
|
|
4
|
+
data.tar.gz: 2fb7356fa0b26ee6f8a09a8ab023a21dcee132aa75fd3d1d87fd5f528a1c3366
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b406e28322db6c9e96db35d108521f617c484cdef0367a6ea246709356d61b5917795289c3caf1cc7324f3228fba349a8b3f9a2b45aeaef0d01872848540db2a
|
|
7
|
+
data.tar.gz: f079139a9cf52c7344d28d55eec1fc108c237c76c23df7880122e66851d858bce86da817887d5a83f35c9732c619328178bfdd6f8cb6742c84024f0445710fed
|
data/.travis.yml
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
dist: trusty
|
|
3
|
-
sudo: false
|
|
4
3
|
group: beta
|
|
5
4
|
cache: bundler
|
|
6
5
|
|
|
@@ -11,10 +10,11 @@ branches:
|
|
|
11
10
|
only: [master]
|
|
12
11
|
|
|
13
12
|
rvm:
|
|
14
|
-
- 2.
|
|
15
|
-
- 2.
|
|
16
|
-
- 2.
|
|
17
|
-
- 2.5
|
|
13
|
+
- 2.3.8
|
|
14
|
+
- 2.4.9
|
|
15
|
+
- 2.5.7
|
|
16
|
+
- 2.6.5
|
|
17
|
+
- 2.7.0
|
|
18
18
|
|
|
19
19
|
env:
|
|
20
20
|
- RAILS_VERSION=4
|
|
@@ -33,13 +33,9 @@ before_install:
|
|
|
33
33
|
|
|
34
34
|
matrix:
|
|
35
35
|
include:
|
|
36
|
-
- rvm:
|
|
37
|
-
env: RAILS_VERSION=4
|
|
38
|
-
- rvm: jruby-1.7.27
|
|
39
|
-
env: JRUBY_OPTS="--dev" RAILS_VERSION=4
|
|
40
|
-
- rvm: jruby-9.2.0.0
|
|
36
|
+
- rvm: jruby-9.2.9.0
|
|
41
37
|
env: JRUBY_OPTS="--dev -J-Djruby.launch.inproc=true -J-Xmx1024M" RAILS_VERSION=4
|
|
42
|
-
- rvm: jruby-9.2.
|
|
38
|
+
- rvm: jruby-9.2.9.0
|
|
43
39
|
env: JRUBY_OPTS="--dev -J-Djruby.launch.inproc=true -J-Xmx1024M" RAILS_VERSION=5
|
|
44
40
|
- rvm: ruby-head
|
|
45
41
|
env: RAILS_VERSION=0
|
data/README.md
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
[](https://dependabot.com/compatibility-score.html?dependency-name=sentry-raven&package-manager=bundler&version-scheme=semver)
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
[Documentation](https://docs.
|
|
16
|
+
[Documentation](https://docs.sentry.io/clients/ruby/) | [Bug Tracker](https://github.com/getsentry/raven-ruby/issues) | [Forum](https://forum.sentry.io/) | IRC: irc.freenode.net, #sentry
|
|
17
17
|
|
|
18
18
|
The official Ruby-language client and integration layer for the [Sentry](https://github.com/getsentry/sentry) error reporting API.
|
|
19
19
|
|
|
20
20
|
## Requirements
|
|
21
21
|
|
|
22
|
-
We test on Ruby
|
|
22
|
+
We test on Ruby 2.3, 2.4, 2.5, 2.6 and 2.7 at the latest patchlevel/teeny version. We also support JRuby 9.0. Our Rails integration works with Rails 4.2+ (including Rails 5).
|
|
23
23
|
|
|
24
24
|
## Getting Started
|
|
25
25
|
|
|
@@ -133,4 +133,4 @@ For more information, see [Context](https://docs.sentry.io/clients/ruby/context/
|
|
|
133
133
|
* [Documentation](https://docs.sentry.io/clients/ruby/)
|
|
134
134
|
* [Bug Tracker](https://github.com/getsentry/raven-ruby/issues)
|
|
135
135
|
* [Forum](https://forum.sentry.io/)
|
|
136
|
-
|
|
136
|
+
- [Discord](https://discord.gg/ez5KZN7)
|
data/changelog.md
CHANGED
|
@@ -1,7 +1,77 @@
|
|
|
1
|
+
3.0.0
|
|
2
|
+
----
|
|
3
|
+
|
|
4
|
+
* SDK now requires Ruby >= 2.3
|
|
5
|
+
* REF: Retain any literal "HTTP-" in header names [@elliterate, #950]
|
|
6
|
+
* REF: Delete JSON spec for recursive hashes [@ksylvest, #952]
|
|
7
|
+
* FEAT: Bump faraday version to latest [@ksylvest, #946]
|
|
8
|
+
|
|
9
|
+
2.13.0
|
|
10
|
+
----
|
|
11
|
+
|
|
12
|
+
* FIX: Sanitize event data before they are sent to async job. [@edariedl, #895]
|
|
13
|
+
* FIX: Serialization MongoDB ObjectId to JSON problem with gem delayed_job_mongoid conjunction. [@eagleas, #935]
|
|
14
|
+
* FEAT: Skip ActiveJob integration if there is a better one [@fsateler, #909]
|
|
15
|
+
* FIX: Bugs with send_event in asynchronous mode (#940) [@cstyles, #940]
|
|
16
|
+
|
|
17
|
+
2.12.3
|
|
18
|
+
----
|
|
19
|
+
|
|
20
|
+
* FIX: crash when Process.wait is used [@asBrettisay, #895]
|
|
21
|
+
|
|
22
|
+
2.12.2
|
|
23
|
+
----
|
|
24
|
+
|
|
25
|
+
* FIX: return tags/extra for [@rivayama, #931]
|
|
26
|
+
|
|
27
|
+
2.12.1
|
|
28
|
+
----
|
|
29
|
+
|
|
30
|
+
* FIX: undefined method `[]' for nil:NilClass [@HazAT, #932]
|
|
31
|
+
|
|
32
|
+
2.12.0
|
|
33
|
+
----
|
|
34
|
+
|
|
35
|
+
* FIX: Remove duplicate message when exception is emitted
|
|
36
|
+
* FIX: Frozen string bug in utf8conversation
|
|
37
|
+
* FEATURE: Allow block on tags_context and extra_context
|
|
38
|
+
|
|
39
|
+
2.11.3
|
|
40
|
+
----
|
|
41
|
+
|
|
42
|
+
* FIX: infinite backoff under pressure [@Bonias, #886]
|
|
43
|
+
|
|
44
|
+
2.11.2
|
|
45
|
+
----
|
|
46
|
+
|
|
47
|
+
* REF: Warn on 4xx error [@iloveitaly, #862]
|
|
48
|
+
|
|
49
|
+
2.11.1
|
|
50
|
+
----
|
|
51
|
+
|
|
52
|
+
* FIX: Call `to_s` on breadcrumb message [@halkeye, #914]
|
|
53
|
+
|
|
54
|
+
2.11.0
|
|
55
|
+
----
|
|
56
|
+
|
|
57
|
+
* FEATURE: Prepend the transaction around_action so libraries with controllers can alter the value. [@drcapulet, #887]
|
|
58
|
+
|
|
59
|
+
2.10.0
|
|
60
|
+
-----
|
|
61
|
+
|
|
62
|
+
* FEATURE: Added support for `SENTRY_ENVIRONMENT` [@mtsmfm, #910]
|
|
63
|
+
* FEATURE: Added support for `SENTRY_RELEASE` [@coorasse, #911]
|
|
64
|
+
|
|
65
|
+
2.9.0
|
|
66
|
+
-----
|
|
67
|
+
|
|
68
|
+
* FEATURE: Added `config.inspect_exception_causes_for_exclusion`. Determines if the exception cause should be inspected for `config.excluded_exceptions` option. [@effron, #872]
|
|
69
|
+
|
|
70
|
+
|
|
1
71
|
2.8.0
|
|
2
72
|
-----
|
|
3
73
|
|
|
4
|
-
* FEATURE: Added `config.before_send`. Provide a lambda or proc to this config setting, which will be `call`ed
|
|
74
|
+
* FEATURE: Added `config.before_send`. Provide a lambda or proc to this config setting, which will be `call`ed before sending an event to Sentry. Receives `event` and `hint` as parameters. `hint` is a hash `{:exception => ex | nil, :message => message | nil}`. [@hazat, #882]
|
|
5
75
|
|
|
6
76
|
2.7.4
|
|
7
77
|
-----
|
data/lib/raven/base.rb
CHANGED
|
@@ -23,6 +23,7 @@ require 'raven/transports'
|
|
|
23
23
|
require 'raven/transports/http'
|
|
24
24
|
require 'raven/utils/deep_merge'
|
|
25
25
|
require 'raven/utils/real_ip'
|
|
26
|
+
require 'raven/utils/exception_cause_chain'
|
|
26
27
|
require 'raven/instance'
|
|
27
28
|
|
|
28
29
|
require 'forwardable'
|
|
@@ -99,7 +100,7 @@ module Raven
|
|
|
99
100
|
|
|
100
101
|
def sys_command(command)
|
|
101
102
|
result = `#{command} 2>&1` rescue nil
|
|
102
|
-
return if result.nil? || result.empty? || $CHILD_STATUS.exitstatus != 0
|
|
103
|
+
return if result.nil? || result.empty? || ($CHILD_STATUS && $CHILD_STATUS.exitstatus != 0)
|
|
103
104
|
result.strip
|
|
104
105
|
end
|
|
105
106
|
end
|
|
@@ -36,7 +36,7 @@ module Raven
|
|
|
36
36
|
|
|
37
37
|
# some loggers will add leading/trailing space as they (incorrectly, mind you)
|
|
38
38
|
# think of logging as a shortcut to std{out,err}
|
|
39
|
-
message = message.strip
|
|
39
|
+
message = message.to_s.strip
|
|
40
40
|
|
|
41
41
|
last_crumb = Raven.breadcrumbs.peek
|
|
42
42
|
# try to avoid dupes from logger broadcasts
|
data/lib/raven/client.rb
CHANGED
|
@@ -35,7 +35,8 @@ module Raven
|
|
|
35
35
|
return
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
event_id = event[:event_id] || event['event_id']
|
|
39
|
+
configuration.logger.info "Sending event #{event_id} to Sentry"
|
|
39
40
|
|
|
40
41
|
content_type, encoded_data = encode(event)
|
|
41
42
|
|
|
@@ -79,8 +80,20 @@ module Raven
|
|
|
79
80
|
end
|
|
80
81
|
end
|
|
81
82
|
|
|
83
|
+
def get_message_from_exception(event)
|
|
84
|
+
(
|
|
85
|
+
event &&
|
|
86
|
+
event[:exception] &&
|
|
87
|
+
event[:exception][:values] &&
|
|
88
|
+
event[:exception][:values][0] &&
|
|
89
|
+
event[:exception][:values][0][:type] &&
|
|
90
|
+
event[:exception][:values][0][:value] &&
|
|
91
|
+
"#{event[:exception][:values][0][:type]}: #{event[:exception][:values][0][:value]}"
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
82
95
|
def get_log_message(event)
|
|
83
|
-
(event && event[:message]) || '<no message value>'
|
|
96
|
+
(event && event[:message]) || (event && event['message']) || get_message_from_exception(event) || '<no message value>'
|
|
84
97
|
end
|
|
85
98
|
|
|
86
99
|
def generate_auth_header
|
|
@@ -100,13 +113,13 @@ module Raven
|
|
|
100
113
|
end
|
|
101
114
|
|
|
102
115
|
def failed_send(e, event)
|
|
103
|
-
@state.failure
|
|
104
116
|
if e # exception was raised
|
|
105
|
-
|
|
117
|
+
@state.failure
|
|
118
|
+
configuration.logger.warn "Unable to record event with remote Sentry server (#{e.class} - #{e.message}):\n#{e.backtrace[0..10].join("\n")}"
|
|
106
119
|
else
|
|
107
|
-
configuration.logger.
|
|
120
|
+
configuration.logger.warn "Not sending event due to previous failure(s)."
|
|
108
121
|
end
|
|
109
|
-
configuration.logger.
|
|
122
|
+
configuration.logger.warn("Failed to submit event: #{get_log_message(event)}")
|
|
110
123
|
configuration.transport_failure_callback.call(event) if configuration.transport_failure_callback
|
|
111
124
|
end
|
|
112
125
|
end
|
data/lib/raven/configuration.rb
CHANGED
|
@@ -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
|
|
@@ -342,21 +347,32 @@ module Raven
|
|
|
342
347
|
end
|
|
343
348
|
|
|
344
349
|
def detect_release
|
|
345
|
-
|
|
350
|
+
detect_release_from_env ||
|
|
351
|
+
detect_release_from_git ||
|
|
346
352
|
detect_release_from_capistrano ||
|
|
347
353
|
detect_release_from_heroku
|
|
348
354
|
rescue => ex
|
|
349
355
|
logger.error "Error detecting release: #{ex.message}"
|
|
350
356
|
end
|
|
351
357
|
|
|
352
|
-
def excluded_exception?(
|
|
353
|
-
excluded_exceptions.any?
|
|
358
|
+
def excluded_exception?(incoming_exception)
|
|
359
|
+
excluded_exceptions.any? do |excluded_exception|
|
|
360
|
+
matches_exception?(get_exception_class(excluded_exception), incoming_exception)
|
|
361
|
+
end
|
|
354
362
|
end
|
|
355
363
|
|
|
356
364
|
def get_exception_class(x)
|
|
357
365
|
x.is_a?(Module) ? x : qualified_const_get(x)
|
|
358
366
|
end
|
|
359
367
|
|
|
368
|
+
def matches_exception?(excluded_exception_class, incoming_exception)
|
|
369
|
+
if inspect_exception_causes_for_exclusion?
|
|
370
|
+
Raven::Utils::ExceptionCauseChain.exception_to_array(incoming_exception).any? { |cause| excluded_exception_class === cause }
|
|
371
|
+
else
|
|
372
|
+
excluded_exception_class === incoming_exception
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
|
|
360
376
|
# In Ruby <2.0 const_get can't lookup "SomeModule::SomeClass" in one go
|
|
361
377
|
def qualified_const_get(x)
|
|
362
378
|
x = x.to_s
|
|
@@ -396,6 +412,10 @@ module Raven
|
|
|
396
412
|
Raven.sys_command("git rev-parse --short HEAD") if File.directory?(".git")
|
|
397
413
|
end
|
|
398
414
|
|
|
415
|
+
def detect_release_from_env
|
|
416
|
+
ENV['SENTRY_RELEASE']
|
|
417
|
+
end
|
|
418
|
+
|
|
399
419
|
def capture_in_current_environment?
|
|
400
420
|
return true unless environments.any? && !environments.include?(current_environment)
|
|
401
421
|
@errors << "Not configured to send/capture in environment '#{current_environment}'"
|
|
@@ -438,7 +458,7 @@ module Raven
|
|
|
438
458
|
end
|
|
439
459
|
|
|
440
460
|
def current_environment_from_env
|
|
441
|
-
ENV['SENTRY_CURRENT_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default'
|
|
461
|
+
ENV['SENTRY_CURRENT_ENV'] || ENV['SENTRY_ENVIRONMENT'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default'
|
|
442
462
|
end
|
|
443
463
|
|
|
444
464
|
def server_name_from_env
|
data/lib/raven/event.rb
CHANGED
|
@@ -59,10 +59,7 @@ module Raven
|
|
|
59
59
|
return unless configuration.exception_class_allowed?(exc)
|
|
60
60
|
|
|
61
61
|
new(options) do |evt|
|
|
62
|
-
evt.message = "#{exc.class}: #{exc.message}"
|
|
63
|
-
|
|
64
62
|
evt.add_exception_interface(exc)
|
|
65
|
-
|
|
66
63
|
yield evt if block
|
|
67
64
|
end
|
|
68
65
|
end
|
|
@@ -139,7 +136,7 @@ module Raven
|
|
|
139
136
|
|
|
140
137
|
def add_exception_interface(exc)
|
|
141
138
|
interface(:exception) do |exc_int|
|
|
142
|
-
exceptions =
|
|
139
|
+
exceptions = Raven::Utils::ExceptionCauseChain.exception_to_array(exc).reverse
|
|
143
140
|
backtraces = Set.new
|
|
144
141
|
exc_int.values = exceptions.map do |e|
|
|
145
142
|
SingleExceptionInterface.new do |int|
|
|
@@ -231,24 +228,7 @@ module Raven
|
|
|
231
228
|
end
|
|
232
229
|
|
|
233
230
|
def async_json_processors
|
|
234
|
-
|
|
235
|
-
Raven::Processor::RemoveCircularReferences,
|
|
236
|
-
Raven::Processor::UTF8Conversion
|
|
237
|
-
].map { |v| v.new(self) }
|
|
238
|
-
end
|
|
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
|
|
231
|
+
configuration.processors.map { |v| v.new(self) }
|
|
252
232
|
end
|
|
253
233
|
|
|
254
234
|
def list_gem_specs
|
data/lib/raven/instance.rb
CHANGED
|
@@ -183,6 +183,10 @@ module Raven
|
|
|
183
183
|
# Raven.tags_context('my_custom_tag' => 'tag_value')
|
|
184
184
|
def tags_context(options = nil)
|
|
185
185
|
context.tags.merge!(options || {})
|
|
186
|
+
yield if block_given?
|
|
187
|
+
context.tags
|
|
188
|
+
ensure
|
|
189
|
+
context.tags.delete_if { |k, _| options.keys.include? k } if block_given?
|
|
186
190
|
end
|
|
187
191
|
|
|
188
192
|
# Bind extra context. Merges with existing context (if any).
|
|
@@ -194,6 +198,10 @@ module Raven
|
|
|
194
198
|
# Raven.extra_context('my_custom_data' => 'value')
|
|
195
199
|
def extra_context(options = nil)
|
|
196
200
|
context.extra.merge!(options || {})
|
|
201
|
+
yield if block_given?
|
|
202
|
+
context.extra
|
|
203
|
+
ensure
|
|
204
|
+
context.extra.delete_if { |k, _| options.keys.include? k } if block_given?
|
|
197
205
|
end
|
|
198
206
|
|
|
199
207
|
def rack_context(env)
|
|
@@ -13,7 +13,7 @@ module Delayed
|
|
|
13
13
|
# Log error to Sentry
|
|
14
14
|
extra = {
|
|
15
15
|
:delayed_job => {
|
|
16
|
-
:id => job.id,
|
|
16
|
+
:id => job.id.to_s,
|
|
17
17
|
:priority => job.priority,
|
|
18
18
|
:attempts => job.attempts,
|
|
19
19
|
:run_at => job.run_at,
|
|
@@ -36,7 +36,7 @@ module Delayed
|
|
|
36
36
|
:logger => 'delayed_job',
|
|
37
37
|
:tags => {
|
|
38
38
|
:delayed_job_queue => job.queue,
|
|
39
|
-
:delayed_job_id => job.id
|
|
39
|
+
:delayed_job_id => job.id.to_s
|
|
40
40
|
},
|
|
41
41
|
:extra => extra)
|
|
42
42
|
|
|
@@ -113,7 +113,7 @@ module Raven
|
|
|
113
113
|
|
|
114
114
|
next unless key.start_with?('HTTP_') || %w(CONTENT_TYPE CONTENT_LENGTH).include?(key)
|
|
115
115
|
# Rack stores headers as HTTP_WHAT_EVER, we need What-Ever
|
|
116
|
-
key = key.
|
|
116
|
+
key = key.sub(/^HTTP_/, "")
|
|
117
117
|
key = key.split('_').map(&:capitalize).join('-')
|
|
118
118
|
memo[key] = value
|
|
119
119
|
rescue StandardError => e
|
|
@@ -9,7 +9,11 @@ module Raven
|
|
|
9
9
|
def self.included(base)
|
|
10
10
|
base.class_eval do
|
|
11
11
|
around_perform do |job, block|
|
|
12
|
-
|
|
12
|
+
if already_supported_by_specific_integration?(job)
|
|
13
|
+
block.call
|
|
14
|
+
else
|
|
15
|
+
capture_and_reraise_with_sentry(job, block)
|
|
16
|
+
end
|
|
13
17
|
end
|
|
14
18
|
end
|
|
15
19
|
end
|
|
@@ -18,9 +22,7 @@ module Raven
|
|
|
18
22
|
block.call
|
|
19
23
|
rescue Exception => exception # rubocop:disable Lint/RescueException
|
|
20
24
|
return if rescue_with_handler(exception)
|
|
21
|
-
|
|
22
|
-
Raven.capture_exception(exception, :extra => raven_context(job))
|
|
23
|
-
end
|
|
25
|
+
Raven.capture_exception(exception, :extra => raven_context(job))
|
|
24
26
|
raise exception
|
|
25
27
|
ensure
|
|
26
28
|
Context.clear!
|
|
@@ -2,7 +2,7 @@ module Raven
|
|
|
2
2
|
class Rails
|
|
3
3
|
module ControllerTransaction
|
|
4
4
|
def self.included(base)
|
|
5
|
-
base.
|
|
5
|
+
base.prepend_around_action do |controller, block|
|
|
6
6
|
Raven.context.transaction.push "#{controller.class}##{controller.action_name}"
|
|
7
7
|
block.call
|
|
8
8
|
Raven.context.transaction.pop
|
|
@@ -39,7 +39,7 @@ module Raven
|
|
|
39
39
|
# https://github.com/rspec/rspec-support/blob/f0af3fd74a94ff7bb700f6ba06dbdc67bba17fbf/lib/rspec/support/encoded_string.rb#L120-L139
|
|
40
40
|
if String.method_defined?(:scrub) # 2.1+
|
|
41
41
|
def remove_invalid_bytes(string)
|
|
42
|
-
string.scrub
|
|
42
|
+
string.scrub(REPLACE)
|
|
43
43
|
end
|
|
44
44
|
else
|
|
45
45
|
def remove_invalid_bytes(string)
|
|
@@ -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
data/sentry-raven.gemspec
CHANGED
|
@@ -5,17 +5,17 @@ Gem::Specification.new do |gem|
|
|
|
5
5
|
gem.name = "sentry-raven"
|
|
6
6
|
gem.authors = ["Sentry Team"]
|
|
7
7
|
gem.description = gem.summary = "A gem that provides a client interface for the Sentry error logger"
|
|
8
|
-
gem.email = "
|
|
8
|
+
gem.email = "accounts@sentry.io"
|
|
9
9
|
gem.license = 'Apache-2.0'
|
|
10
10
|
gem.homepage = "https://github.com/getsentry/raven-ruby"
|
|
11
11
|
|
|
12
12
|
gem.version = Raven::VERSION
|
|
13
13
|
gem.platform = Gem::Platform::RUBY
|
|
14
|
-
gem.required_ruby_version = '>=
|
|
14
|
+
gem.required_ruby_version = '>= 2.3'
|
|
15
15
|
gem.extra_rdoc_files = ["README.md", "LICENSE"]
|
|
16
16
|
gem.files = `git ls-files | grep -Ev '^(spec|benchmarks|examples)'`.split("\n")
|
|
17
17
|
gem.bindir = "exe"
|
|
18
18
|
gem.executables = "raven"
|
|
19
19
|
|
|
20
|
-
gem.add_dependency "faraday", ">=
|
|
20
|
+
gem.add_dependency "faraday", ">= 1.0"
|
|
21
21
|
end
|
metadata
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sentry-raven
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.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:
|
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.7.6
|
|
20
|
-
- - "<"
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
19
|
version: '1.0'
|
|
23
20
|
type: :runtime
|
|
@@ -25,13 +22,10 @@ dependencies:
|
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
24
|
- - ">="
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: 0.7.6
|
|
30
|
-
- - "<"
|
|
31
25
|
- !ruby/object:Gem::Version
|
|
32
26
|
version: '1.0'
|
|
33
27
|
description: A gem that provides a client interface for the Sentry error logger
|
|
34
|
-
email:
|
|
28
|
+
email: accounts@sentry.io
|
|
35
29
|
executables:
|
|
36
30
|
- raven
|
|
37
31
|
extensions: []
|
|
@@ -96,6 +90,7 @@ files:
|
|
|
96
90
|
- lib/raven/transports/http.rb
|
|
97
91
|
- lib/raven/transports/stdout.rb
|
|
98
92
|
- lib/raven/utils/deep_merge.rb
|
|
93
|
+
- lib/raven/utils/exception_cause_chain.rb
|
|
99
94
|
- lib/raven/utils/real_ip.rb
|
|
100
95
|
- lib/raven/version.rb
|
|
101
96
|
- lib/sentry-raven-without-integrations.rb
|
|
@@ -113,15 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
113
108
|
requirements:
|
|
114
109
|
- - ">="
|
|
115
110
|
- !ruby/object:Gem::Version
|
|
116
|
-
version:
|
|
111
|
+
version: '2.3'
|
|
117
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
113
|
requirements:
|
|
119
114
|
- - ">="
|
|
120
115
|
- !ruby/object:Gem::Version
|
|
121
116
|
version: '0'
|
|
122
117
|
requirements: []
|
|
123
|
-
|
|
124
|
-
rubygems_version: 2.5.2.3
|
|
118
|
+
rubygems_version: 3.0.3
|
|
125
119
|
signing_key:
|
|
126
120
|
specification_version: 4
|
|
127
121
|
summary: A gem that provides a client interface for the Sentry error logger
|